{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 基于Pybroker框架的量化交易策略\n",
    "\n",
    "* 量化交易策略平台：掘金，聚宽，米筐，优矿等\n",
    "* 常见的量化交易策略库：Zipline、Backtrader、PyBroker等\n",
    "\n",
    "## 什么是量化交易策略\n",
    "\n",
    "量化交易策略是指通过数学模型和算法，对金融市场的价格、趋势、波动等数据进行挖掘和分析，从而制定出买卖股票、期货、外汇等金融产品的交易策略。\n",
    "\n",
    "## pybroker框架\n",
    "\n",
    "pybroker是一个基于Python的量化交易策略框架，它提供了一套完整的量化交易策略开发、回测、模拟和实盘交易的功能。\n",
    "\n",
    "https://www.pybroker.com/zh-cn/latest/index.html\n",
    "\n",
    "https://github.com/edtechre/pybroker/tree/master\n",
    "\n",
    "* 库很新，学习资源少，除了官方文档，没有其他学习资料，借助大模型阅读源代码进行提问学习会有帮助\n",
    "* 使用简单，速度快，支持在线akshare数据源也支持离线数据，对机器学习模型支持友好\n",
    "\n",
    "## pybroker安装（本课程第一次课大部分同学已经完成安装不需要再走下面的流程）\n",
    "\n",
    "* 直接pip通常可以：pip install lib-pybroker -i https://pypi.tuna.tsinghua.edu.cn/simple\n",
    "* 建议先创建虚拟环境在再在虚拟环境中装库（如果直接装好能用那就不用搞虚拟环境）\n",
    "* 如果想要和talib结合，某些版本因为numpy版本冲突，可能需要先安装ta-lib再安装pybroker\n",
    "\n",
    "ta_lib安装需要下载对应版本的ta_lib库\n",
    "\n",
    "https://github.com/cgohlke/talib-build/releases\n",
    "\n",
    "## pybroker与akshare的使用\n",
    "\n",
    "* 由于akshare是一个爬虫接口，对应数据源通常会不稳定，一旦出现异常常用手段就是保持更新\n",
    "\n",
    "* pip install --upgrade lib-pybroker akshare -i https://pypi.tuna.tsinghua.edu.cn/simple"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## pybroker 的数据形式与离线保存\n",
    "\n",
    "* pybroker对数据的要求\n",
    "\n",
    "* 离线保存后，pybroker会自动读取离线数据，避免总是网络获取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<diskcache.core.Cache at 0x22e25d29f50>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pybroker\n",
    "from pybroker.ext.data import AKShare\n",
    "from pybroker import ExecContext, StrategyConfig, Strategy\n",
    "from pybroker.ext.data import AKShare\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "akshare = AKShare()\n",
    "\n",
    "pybroker.enable_data_source_cache('akshare')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loaded cached bar data.\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>symbol</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2021-03-02</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>3653.44</td>\n",
       "      <td>3739.58</td>\n",
       "      <td>3594.93</td>\n",
       "      <td>3658.31</td>\n",
       "      <td>1473425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2021-03-03</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>3646.94</td>\n",
       "      <td>3890.73</td>\n",
       "      <td>3627.43</td>\n",
       "      <td>3879.35</td>\n",
       "      <td>1919635</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2021-03-04</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>3840.34</td>\n",
       "      <td>3957.36</td>\n",
       "      <td>3820.84</td>\n",
       "      <td>3864.72</td>\n",
       "      <td>1213579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2021-03-05</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>3828.97</td>\n",
       "      <td>3874.48</td>\n",
       "      <td>3692.44</td>\n",
       "      <td>3770.46</td>\n",
       "      <td>880171</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2021-03-08</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>3786.71</td>\n",
       "      <td>3827.34</td>\n",
       "      <td>3630.68</td>\n",
       "      <td>3650.19</td>\n",
       "      <td>993774</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>967</th>\n",
       "      <td>2023-02-23</td>\n",
       "      <td>600000.SH</td>\n",
       "      <td>77.41</td>\n",
       "      <td>77.61</td>\n",
       "      <td>77.28</td>\n",
       "      <td>77.28</td>\n",
       "      <td>114365</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>968</th>\n",
       "      <td>2023-02-24</td>\n",
       "      <td>600000.SH</td>\n",
       "      <td>77.22</td>\n",
       "      <td>77.48</td>\n",
       "      <td>76.95</td>\n",
       "      <td>76.95</td>\n",
       "      <td>166811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>969</th>\n",
       "      <td>2023-02-27</td>\n",
       "      <td>600000.SH</td>\n",
       "      <td>76.82</td>\n",
       "      <td>77.08</td>\n",
       "      <td>76.82</td>\n",
       "      <td>76.82</td>\n",
       "      <td>158006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>970</th>\n",
       "      <td>2023-02-28</td>\n",
       "      <td>600000.SH</td>\n",
       "      <td>76.95</td>\n",
       "      <td>77.08</td>\n",
       "      <td>76.69</td>\n",
       "      <td>76.95</td>\n",
       "      <td>174481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>971</th>\n",
       "      <td>2023-03-01</td>\n",
       "      <td>600000.SH</td>\n",
       "      <td>76.89</td>\n",
       "      <td>77.54</td>\n",
       "      <td>76.89</td>\n",
       "      <td>77.48</td>\n",
       "      <td>256613</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>972 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          date     symbol     open     high      low    close   volume\n",
       "0   2021-03-02  000001.SZ  3653.44  3739.58  3594.93  3658.31  1473425\n",
       "1   2021-03-03  000001.SZ  3646.94  3890.73  3627.43  3879.35  1919635\n",
       "2   2021-03-04  000001.SZ  3840.34  3957.36  3820.84  3864.72  1213579\n",
       "3   2021-03-05  000001.SZ  3828.97  3874.48  3692.44  3770.46   880171\n",
       "4   2021-03-08  000001.SZ  3786.71  3827.34  3630.68  3650.19   993774\n",
       "..         ...        ...      ...      ...      ...      ...      ...\n",
       "967 2023-02-23  600000.SH    77.41    77.61    77.28    77.28   114365\n",
       "968 2023-02-24  600000.SH    77.22    77.48    76.95    76.95   166811\n",
       "969 2023-02-27  600000.SH    76.82    77.08    76.82    76.82   158006\n",
       "970 2023-02-28  600000.SH    76.95    77.08    76.69    76.95   174481\n",
       "971 2023-03-01  600000.SH    76.89    77.54    76.89    77.48   256613\n",
       "\n",
       "[972 rows x 7 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 获取股票数据\n",
    "# 你可以用000001替换000001.SZ，程序仍然可以正常运行！\n",
    "# 并且你可以将起始日期设置为“20210301”这种格式。\n",
    "# 你还可以将“adjust”设置为“qfq”（前复权）或“hfq”（后复权）来调整数据，\n",
    "# 并将“timeframe”设置为“1d”（日数据）、“1w”（周数据）以获取每日、每周的数据。 \n",
    "df = akshare.query(\n",
    "    symbols=['000001.SZ', '600000.SH'],\n",
    "    start_date='3/2/2021',\n",
    "    end_date='3/1/2023',\n",
    "    adjust=\"hfq\",\n",
    "    timeframe=\"1d\",\n",
    ")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loaded cached bar data.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "df = akshare.query(symbols='000001', start_date='20200101', end_date='20230830', adjust='')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>symbol</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2020-01-02</td>\n",
       "      <td>000001</td>\n",
       "      <td>16.65</td>\n",
       "      <td>16.95</td>\n",
       "      <td>16.55</td>\n",
       "      <td>16.87</td>\n",
       "      <td>1530232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2020-01-03</td>\n",
       "      <td>000001</td>\n",
       "      <td>16.94</td>\n",
       "      <td>17.31</td>\n",
       "      <td>16.92</td>\n",
       "      <td>17.18</td>\n",
       "      <td>1116195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2020-01-06</td>\n",
       "      <td>000001</td>\n",
       "      <td>17.01</td>\n",
       "      <td>17.34</td>\n",
       "      <td>16.91</td>\n",
       "      <td>17.07</td>\n",
       "      <td>862084</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2020-01-07</td>\n",
       "      <td>000001</td>\n",
       "      <td>17.13</td>\n",
       "      <td>17.28</td>\n",
       "      <td>16.95</td>\n",
       "      <td>17.15</td>\n",
       "      <td>728608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2020-01-08</td>\n",
       "      <td>000001</td>\n",
       "      <td>17.00</td>\n",
       "      <td>17.05</td>\n",
       "      <td>16.63</td>\n",
       "      <td>16.66</td>\n",
       "      <td>847824</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>884</th>\n",
       "      <td>2023-08-24</td>\n",
       "      <td>000001</td>\n",
       "      <td>11.29</td>\n",
       "      <td>11.32</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.13</td>\n",
       "      <td>1291271</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>885</th>\n",
       "      <td>2023-08-25</td>\n",
       "      <td>000001</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.23</td>\n",
       "      <td>845350</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>2023-08-28</td>\n",
       "      <td>000001</td>\n",
       "      <td>11.84</td>\n",
       "      <td>11.93</td>\n",
       "      <td>11.49</td>\n",
       "      <td>11.52</td>\n",
       "      <td>1997610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>2023-08-29</td>\n",
       "      <td>000001</td>\n",
       "      <td>11.47</td>\n",
       "      <td>11.49</td>\n",
       "      <td>11.13</td>\n",
       "      <td>11.31</td>\n",
       "      <td>1964961</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>2023-08-30</td>\n",
       "      <td>000001</td>\n",
       "      <td>11.27</td>\n",
       "      <td>11.27</td>\n",
       "      <td>11.13</td>\n",
       "      <td>11.13</td>\n",
       "      <td>1375638</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>889 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          date  symbol   open   high    low  close   volume\n",
       "0   2020-01-02  000001  16.65  16.95  16.55  16.87  1530232\n",
       "1   2020-01-03  000001  16.94  17.31  16.92  17.18  1116195\n",
       "2   2020-01-06  000001  17.01  17.34  16.91  17.07   862084\n",
       "3   2020-01-07  000001  17.13  17.28  16.95  17.15   728608\n",
       "4   2020-01-08  000001  17.00  17.05  16.63  16.66   847824\n",
       "..         ...     ...    ...    ...    ...    ...      ...\n",
       "884 2023-08-24  000001  11.29  11.32  11.05  11.13  1291271\n",
       "885 2023-08-25  000001  11.10  11.33  11.08  11.23   845350\n",
       "886 2023-08-28  000001  11.84  11.93  11.49  11.52  1997610\n",
       "887 2023-08-29  000001  11.47  11.49  11.13  11.31  1964961\n",
       "888 2023-08-30  000001  11.27  11.27  11.13  11.13  1375638\n",
       "\n",
       "[889 rows x 7 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 第一个量化策略\n",
    "\n",
    "* 数据的导入\n",
    "\n",
    "* 策略函数的编写与运行机制：每天每个股票都会运行一次\n",
    "\n",
    "* 策略的结果分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Backtesting: 2023-08-01 00:00:00 to 2023-08-30 00:00:00\n",
      "\n",
      "Loaded cached bar data.\n",
      "\n",
      "Test split: 2023-08-01 00:00:00 to 2023-08-30 00:00:00\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  0% (0 of 22) |                         | Elapsed Time: 0:00:00 ETA:  --:--:--\n",
      "100% (22 of 22) |########################| Elapsed Time: 0:00:00 ETA:  00:00:00\n",
      "100% (22 of 22) |########################| Elapsed Time: 0:00:00 Time:  0:00:00\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n",
      "None\n",
      "Position(symbol='000001', shares=Decimal('20559'), type='long', close=Decimal('12.03'), equity=Decimal('247324.77'), market_value=Decimal('247324.77'), margin=Decimal('0'), pnl=Decimal('-1027.95'), entries=deque([Entry(id=1, date=numpy.datetime64('2023-08-02T00:00:00.000000000'), symbol='000001', shares=Decimal('20559'), price=Decimal('12.08'), type='long', bars=0, stops=[Stop(id=145, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.15'), mfe=Decimal('0.16'))]), bars=0)\n",
      "Position(symbol='600000', shares=Decimal('32894'), type='long', close=Decimal('7.48'), equity=Decimal('246047.12'), market_value=Decimal('246047.12'), margin=Decimal('0'), pnl=Decimal('-986.82'), entries=deque([Entry(id=2, date=numpy.datetime64('2023-08-02T00:00:00.000000000'), symbol='600000', shares=Decimal('32894'), price=Decimal('7.51'), type='long', bars=0, stops=[Stop(id=146, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.08'), mfe=Decimal('0.08'))]), bars=0)\n",
      "Position(symbol='000001', shares=Decimal('20559'), type='long', close=Decimal('12.33'), equity=Decimal('253492.47'), market_value=Decimal('253492.47'), margin=Decimal('0'), pnl=Decimal('5139.75'), entries=deque([Entry(id=1, date=numpy.datetime64('2023-08-02T00:00:00.000000000'), symbol='000001', shares=Decimal('20559'), price=Decimal('12.08'), type='long', bars=1, stops=[Stop(id=145, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.15'), mfe=Decimal('0.29'))]), bars=1)\n",
      "Position(symbol='600000', shares=Decimal('32894'), type='long', close=Decimal('7.56'), equity=Decimal('248678.64'), market_value=Decimal('248678.64'), margin=Decimal('0'), pnl=Decimal('1644.70'), entries=deque([Entry(id=2, date=numpy.datetime64('2023-08-02T00:00:00.000000000'), symbol='600000', shares=Decimal('32894'), price=Decimal('7.51'), type='long', bars=1, stops=[Stop(id=146, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.08'), mfe=Decimal('0.08'))]), bars=1)\n",
      "Position(symbol='000001', shares=Decimal('20559'), type='long', close=Decimal('12.3'), equity=Decimal('252875.7'), market_value=Decimal('252875.7'), margin=Decimal('0'), pnl=Decimal('4522.98'), entries=deque([Entry(id=1, date=numpy.datetime64('2023-08-02T00:00:00.000000000'), symbol='000001', shares=Decimal('20559'), price=Decimal('12.08'), type='long', bars=2, stops=[Stop(id=145, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.15'), mfe=Decimal('0.45'))]), bars=2)\n",
      "Position(symbol='600000', shares=Decimal('32894'), type='long', close=Decimal('7.58'), equity=Decimal('249336.52'), market_value=Decimal('249336.52'), margin=Decimal('0'), pnl=Decimal('2302.58'), entries=deque([Entry(id=2, date=numpy.datetime64('2023-08-02T00:00:00.000000000'), symbol='600000', shares=Decimal('32894'), price=Decimal('7.51'), type='long', bars=2, stops=[Stop(id=146, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.08'), mfe=Decimal('0.14'))]), bars=2)\n",
      "None\n",
      "None\n",
      "Position(symbol='000001', shares=Decimal('20670'), type='long', close=Decimal('12.1'), equity=Decimal('250107.0'), market_value=Decimal('250107.0'), margin=Decimal('0'), pnl=Decimal('0.0'), entries=deque([Entry(id=3, date=numpy.datetime64('2023-08-08T00:00:00.000000000'), symbol='000001', shares=Decimal('20670'), price=Decimal('12.1'), type='long', bars=0, stops=[Stop(id=147, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.1'), mfe=Decimal('0.11'))]), bars=0)\n",
      "Position(symbol='600000', shares=Decimal('33425'), type='long', close=Decimal('7.52'), equity=Decimal('251356.00'), market_value=Decimal('251356.00'), margin=Decimal('0'), pnl=Decimal('1002.75'), entries=deque([Entry(id=4, date=numpy.datetime64('2023-08-08T00:00:00.000000000'), symbol='600000', shares=Decimal('33425'), price=Decimal('7.49'), type='long', bars=0, stops=[Stop(id=148, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.06'), mfe=Decimal('0.06'))]), bars=0)\n",
      "Position(symbol='000001', shares=Decimal('20670'), type='long', close=Decimal('12.17'), equity=Decimal('251553.90'), market_value=Decimal('251553.90'), margin=Decimal('0'), pnl=Decimal('1446.90'), entries=deque([Entry(id=3, date=numpy.datetime64('2023-08-08T00:00:00.000000000'), symbol='000001', shares=Decimal('20670'), price=Decimal('12.1'), type='long', bars=1, stops=[Stop(id=147, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.1'), mfe=Decimal('0.11'))]), bars=1)\n",
      "Position(symbol='600000', shares=Decimal('33425'), type='long', close=Decimal('7.55'), equity=Decimal('252358.75'), market_value=Decimal('252358.75'), margin=Decimal('0'), pnl=Decimal('2005.50'), entries=deque([Entry(id=4, date=numpy.datetime64('2023-08-08T00:00:00.000000000'), symbol='600000', shares=Decimal('33425'), price=Decimal('7.49'), type='long', bars=1, stops=[Stop(id=148, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.06'), mfe=Decimal('0.06'))]), bars=1)\n",
      "Position(symbol='000001', shares=Decimal('20670'), type='long', close=Decimal('12.16'), equity=Decimal('251347.20'), market_value=Decimal('251347.20'), margin=Decimal('0'), pnl=Decimal('1240.20'), entries=deque([Entry(id=3, date=numpy.datetime64('2023-08-08T00:00:00.000000000'), symbol='000001', shares=Decimal('20670'), price=Decimal('12.1'), type='long', bars=2, stops=[Stop(id=147, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.1'), mfe=Decimal('0.11'))]), bars=2)\n",
      "Position(symbol='600000', shares=Decimal('33425'), type='long', close=Decimal('7.42'), equity=Decimal('248013.50'), market_value=Decimal('248013.50'), margin=Decimal('0'), pnl=Decimal('-2339.75'), entries=deque([Entry(id=4, date=numpy.datetime64('2023-08-08T00:00:00.000000000'), symbol='600000', shares=Decimal('33425'), price=Decimal('7.49'), type='long', bars=2, stops=[Stop(id=148, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.14'), mfe=Decimal('0.06'))]), bars=2)\n",
      "None\n",
      "None\n",
      "Position(symbol='000001', shares=Decimal('20911'), type='long', close=Decimal('11.67'), equity=Decimal('244031.37'), market_value=Decimal('244031.37'), margin=Decimal('0'), pnl=Decimal('-209.11'), entries=deque([Entry(id=5, date=numpy.datetime64('2023-08-14T00:00:00.000000000'), symbol='000001', shares=Decimal('20911'), price=Decimal('11.68'), type='long', bars=0, stops=[Stop(id=149, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.09'), mfe=Decimal('0.10'))]), bars=0)\n",
      "Position(symbol='600000', shares=Decimal('34390'), type='long', close=Decimal('7.1'), equity=Decimal('244169.0'), market_value=Decimal('244169.0'), margin=Decimal('0'), pnl=Decimal('-687.80'), entries=deque([Entry(id=6, date=numpy.datetime64('2023-08-14T00:00:00.000000000'), symbol='600000', shares=Decimal('34390'), price=Decimal('7.12'), type='long', bars=0, stops=[Stop(id=150, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.07'), mfe=Decimal('0.08'))]), bars=0)\n",
      "Position(symbol='000001', shares=Decimal('20911'), type='long', close=Decimal('11.73'), equity=Decimal('245286.03'), market_value=Decimal('245286.03'), margin=Decimal('0'), pnl=Decimal('1045.55'), entries=deque([Entry(id=5, date=numpy.datetime64('2023-08-14T00:00:00.000000000'), symbol='000001', shares=Decimal('20911'), price=Decimal('11.68'), type='long', bars=1, stops=[Stop(id=149, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.09'), mfe=Decimal('0.12'))]), bars=1)\n",
      "Position(symbol='600000', shares=Decimal('34390'), type='long', close=Decimal('7.17'), equity=Decimal('246576.30'), market_value=Decimal('246576.30'), margin=Decimal('0'), pnl=Decimal('1719.50'), entries=deque([Entry(id=6, date=numpy.datetime64('2023-08-14T00:00:00.000000000'), symbol='600000', shares=Decimal('34390'), price=Decimal('7.12'), type='long', bars=1, stops=[Stop(id=150, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.07'), mfe=Decimal('0.08'))]), bars=1)\n",
      "Position(symbol='000001', shares=Decimal('20911'), type='long', close=Decimal('11.73'), equity=Decimal('245286.03'), market_value=Decimal('245286.03'), margin=Decimal('0'), pnl=Decimal('1045.55'), entries=deque([Entry(id=5, date=numpy.datetime64('2023-08-14T00:00:00.000000000'), symbol='000001', shares=Decimal('20911'), price=Decimal('11.68'), type='long', bars=2, stops=[Stop(id=149, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.09'), mfe=Decimal('0.17'))]), bars=2)\n",
      "Position(symbol='600000', shares=Decimal('34390'), type='long', close=Decimal('7.14'), equity=Decimal('245544.60'), market_value=Decimal('245544.60'), margin=Decimal('0'), pnl=Decimal('687.80'), entries=deque([Entry(id=6, date=numpy.datetime64('2023-08-14T00:00:00.000000000'), symbol='600000', shares=Decimal('34390'), price=Decimal('7.12'), type='long', bars=2, stops=[Stop(id=150, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.07'), mfe=Decimal('0.08'))]), bars=2)\n",
      "None\n",
      "None\n",
      "Position(symbol='000001', shares=Decimal('21370'), type='long', close=Decimal('11.56'), equity=Decimal('247037.20'), market_value=Decimal('247037.20'), margin=Decimal('0'), pnl=Decimal('-1709.60'), entries=deque([Entry(id=7, date=numpy.datetime64('2023-08-18T00:00:00.000000000'), symbol='000001', shares=Decimal('21370'), price=Decimal('11.64'), type='long', bars=0, stops=[Stop(id=151, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.11'), mfe=Decimal('0.10'))]), bars=0)\n",
      "Position(symbol='600000', shares=Decimal('34516'), type='long', close=Decimal('7.07'), equity=Decimal('244028.12'), market_value=Decimal('244028.12'), margin=Decimal('0'), pnl=Decimal('-1725.80'), entries=deque([Entry(id=8, date=numpy.datetime64('2023-08-18T00:00:00.000000000'), symbol='600000', shares=Decimal('34516'), price=Decimal('7.12'), type='long', bars=0, stops=[Stop(id=152, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.05'), mfe=Decimal('0.05'))]), bars=0)\n",
      "Position(symbol='000001', shares=Decimal('21370'), type='long', close=Decimal('11.32'), equity=Decimal('241908.40'), market_value=Decimal('241908.40'), margin=Decimal('0'), pnl=Decimal('-6838.40'), entries=deque([Entry(id=7, date=numpy.datetime64('2023-08-18T00:00:00.000000000'), symbol='000001', shares=Decimal('21370'), price=Decimal('11.64'), type='long', bars=1, stops=[Stop(id=151, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.32'), mfe=Decimal('0.10'))]), bars=1)\n",
      "Position(symbol='600000', shares=Decimal('34516'), type='long', close=Decimal('6.96'), equity=Decimal('240231.36'), market_value=Decimal('240231.36'), margin=Decimal('0'), pnl=Decimal('-5522.56'), entries=deque([Entry(id=8, date=numpy.datetime64('2023-08-18T00:00:00.000000000'), symbol='600000', shares=Decimal('34516'), price=Decimal('7.12'), type='long', bars=1, stops=[Stop(id=152, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.16'), mfe=Decimal('0.05'))]), bars=1)\n",
      "Position(symbol='000001', shares=Decimal('21370'), type='long', close=Decimal('11.37'), equity=Decimal('242976.90'), market_value=Decimal('242976.90'), margin=Decimal('0'), pnl=Decimal('-5769.90'), entries=deque([Entry(id=7, date=numpy.datetime64('2023-08-18T00:00:00.000000000'), symbol='000001', shares=Decimal('21370'), price=Decimal('11.64'), type='long', bars=2, stops=[Stop(id=151, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.33'), mfe=Decimal('0.10'))]), bars=2)\n",
      "Position(symbol='600000', shares=Decimal('34516'), type='long', close=Decimal('7.01'), equity=Decimal('241957.16'), market_value=Decimal('241957.16'), margin=Decimal('0'), pnl=Decimal('-3796.76'), entries=deque([Entry(id=8, date=numpy.datetime64('2023-08-18T00:00:00.000000000'), symbol='600000', shares=Decimal('34516'), price=Decimal('7.12'), type='long', bars=2, stops=[Stop(id=152, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.16'), mfe=Decimal('0.05'))]), bars=2)\n",
      "None\n",
      "None\n",
      "Position(symbol='000001', shares=Decimal('21560'), type='long', close=Decimal('11.13'), equity=Decimal('239962.80'), market_value=Decimal('239962.80'), margin=Decimal('0'), pnl=Decimal('-1078.00'), entries=deque([Entry(id=9, date=numpy.datetime64('2023-08-24T00:00:00.000000000'), symbol='000001', shares=Decimal('21560'), price=Decimal('11.18'), type='long', bars=0, stops=[Stop(id=153, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.13'), mfe=Decimal('0.14'))]), bars=0)\n",
      "Position(symbol='600000', shares=Decimal('34552'), type='long', close=Decimal('6.99'), equity=Decimal('241518.48'), market_value=Decimal('241518.48'), margin=Decimal('0'), pnl=Decimal('-1036.56'), entries=deque([Entry(id=10, date=numpy.datetime64('2023-08-24T00:00:00.000000000'), symbol='600000', shares=Decimal('34552'), price=Decimal('7.02'), type='long', bars=0, stops=[Stop(id=154, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.04'), mfe=Decimal('0.04'))]), bars=0)\n",
      "Position(symbol='000001', shares=Decimal('21560'), type='long', close=Decimal('11.23'), equity=Decimal('242118.80'), market_value=Decimal('242118.80'), margin=Decimal('0'), pnl=Decimal('1078.00'), entries=deque([Entry(id=9, date=numpy.datetime64('2023-08-24T00:00:00.000000000'), symbol='000001', shares=Decimal('21560'), price=Decimal('11.18'), type='long', bars=1, stops=[Stop(id=153, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.13'), mfe=Decimal('0.15'))]), bars=1)\n",
      "Position(symbol='600000', shares=Decimal('34552'), type='long', close=Decimal('7.05'), equity=Decimal('243591.60'), market_value=Decimal('243591.60'), margin=Decimal('0'), pnl=Decimal('1036.56'), entries=deque([Entry(id=10, date=numpy.datetime64('2023-08-24T00:00:00.000000000'), symbol='600000', shares=Decimal('34552'), price=Decimal('7.02'), type='long', bars=1, stops=[Stop(id=154, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.05'), mfe=Decimal('0.07'))]), bars=1)\n",
      "Position(symbol='000001', shares=Decimal('21560'), type='long', close=Decimal('11.52'), equity=Decimal('248371.20'), market_value=Decimal('248371.20'), margin=Decimal('0'), pnl=Decimal('7330.40'), entries=deque([Entry(id=9, date=numpy.datetime64('2023-08-24T00:00:00.000000000'), symbol='000001', shares=Decimal('21560'), price=Decimal('11.18'), type='long', bars=2, stops=[Stop(id=153, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.13'), mfe=Decimal('0.75'))]), bars=2)\n",
      "Position(symbol='600000', shares=Decimal('34552'), type='long', close=Decimal('7.15'), equity=Decimal('247046.80'), market_value=Decimal('247046.80'), margin=Decimal('0'), pnl=Decimal('4491.76'), entries=deque([Entry(id=10, date=numpy.datetime64('2023-08-24T00:00:00.000000000'), symbol='600000', shares=Decimal('34552'), price=Decimal('7.02'), type='long', bars=2, stops=[Stop(id=154, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.05'), mfe=Decimal('0.30'))]), bars=2)\n",
      "None\n",
      "None\n",
      "Position(symbol='000001', shares=Decimal('21723'), type='long', close=Decimal('11.13'), equity=Decimal('241776.99'), market_value=Decimal('241776.99'), margin=Decimal('0'), pnl=Decimal('-1520.61'), entries=deque([Entry(id=11, date=numpy.datetime64('2023-08-30T00:00:00.000000000'), symbol='000001', shares=Decimal('21723'), price=Decimal('11.2'), type='long', bars=0, stops=[Stop(id=155, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.07'), mfe=Decimal('0.07'))]), bars=0)\n",
      "Position(symbol='600000', shares=Decimal('34751'), type='long', close=Decimal('7.03'), equity=Decimal('244299.53'), market_value=Decimal('244299.53'), margin=Decimal('0'), pnl=Decimal('-1042.53'), entries=deque([Entry(id=12, date=numpy.datetime64('2023-08-30T00:00:00.000000000'), symbol='600000', shares=Decimal('34751'), price=Decimal('7.06'), type='long', bars=0, stops=[Stop(id=156, symbol='600000', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.05'), mfe=Decimal('0.04'))]), bars=0)\n",
      "\n",
      "Finished backtest: 0:00:00\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# 定义交易策略函数\n",
    "def buy_func(ctx: ExecContext) -> None:\n",
    "    pos = ctx.long_pos()  # 获取当前的长期持有的股票\n",
    "    print(pos)\n",
    "    #print(ctx.date[-1])\n",
    "    #print(ctx.volume)\n",
    "    #print(ctx.symbol)\n",
    "    if pos:  # 如果当前持有股票\n",
    "        #ctx.sell_shares = pos.shares  # 卖出所有的股票\n",
    "        pass\n",
    "    else:  # 如果当前没有持有股票\n",
    "        ctx.buy_shares = ctx.calc_target_shares(0.5)  # 买入全部可购买的股票\n",
    "        ctx.hold_bars = 3  # 设置持有的交易日为3天\n",
    "\n",
    "\n",
    "# 创建策略配置对象，设置初始现金为 500,000 元\n",
    "my_config = StrategyConfig(initial_cash=500000)\n",
    "\n",
    "# 创建策略对象，设置数据源为 AKShare，开始日期为 '20230801'，结束日期为 '20230830'，策略配置为 my_config\n",
    "strategy = Strategy(data_source=AKShare(), start_date='20230801', end_date='20230830', config=my_config)\n",
    "\n",
    "# 将定义的交易策略函数添加到策略对象中，应用于股票 '000001'\n",
    "strategy.add_execution(fn=buy_func, symbols=['000001',\"600000\"])\n",
    "\n",
    "# 执行回测\n",
    "result = strategy.backtest()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Axes: xlabel='date'>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkIAAAHhCAYAAACCx9HdAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAZAxJREFUeJzt3Qd4FNXXBvA3vRfSE0iA0Am9g1RFQBFFFBRQ0Q87oIiiYsOOigXs7S82kCKCioh0kN5LAgkdAmmQkN6T/Z57N7smECBtd2Z23t/zrJndnZ29ScA93HvuOXYGg8EAIiIiIh2yV3oAREREREphIERERES6xUCIiIiIdIuBEBEREekWAyEiIiLSLQZCREREpFsMhIiIiEi3GAgRERGRbjkqPQA1Ky0tRUJCAry8vGBnZ6f0cIiIiKgKRK3orKwshIWFwd7+6nM+DISuQgRB4eHhSg+DiIiIaiA+Ph4NGjS46jkMhK5CzASZfpDe3t5KD4eIiIiqIDMzU05kmD7Hr4aB0FWYlsNEEMRAiIiISFuqktbCZGkiIiLSLQZCREREpFsMhIiIiEi3GAgRERGRbjEQIiIiIt1iIERERES6xUCIiIiIdIuBEBEREekWAyEiIiLSLQZCREREpFsMhIiIiEi3GAgRERGRbrHpqg1LzMjDxZwiFJWUyluh/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WFiI3bt3Y+DAgRWqgIr7W7duvex8ce6+ffswfvx4K4+U6lppaamcap86dSqioqKUHg7VgKjPIlSlhQFp+/faq1cvOXuflpYm/+7Onz8f+fn5chnUFjAQIsVcuHABJSUlCA4OrvC4uC/WpC/1v//9D61atZJ/KUnb3n33XTg6OuKJJ55QeihUA+LDcPLkybjuuuvQpk0bpYdDFv69Lly4UC6Z+fv7y7o8jzzyiFzWbtq0KWwBe42RJuTl5WHevHl4+eWXlR4K1ZKY2Zs9e7bMCRMJtaQ9IqckOjoamzZtUnooZIXf68svvywT31evXo2AgAC5+UHkCP37779o27YttI6BEClG/IUSDfeSk5MrPC7ui90J5f36668yEVMk7ZG2if95imR40RnaRMwMPv3003LnmNgtSOo1ceJELFu2TO4MbNCggdLDIQv/Xo8fP45PP/1UBkimZWyxEUL8PRabIb788ktoHZfGSDHOzs7o3Lkz1qxZU2FqVtzv2bPnZctit956KwIDAxUYKdUlkRt04MABme9luoldYyJf6J9//lF6eHQFIu9dfFiKJZG1a9eicePGSg+JrPB7zc3NrbSLu/hHrPj/tS3gjBApSmydHzduHLp06YJu3brJGQGxbfOBBx4wn3Ps2DH5r5Tly5crOlaquuzsbPl7Mzl58qQMeEQCppgJErkG5Tk5OclZwBYtWigwWqrqsolYnv79999lzRlTHp9obOnm5iaPxWPiZvrdi63W4lzxO2dStTZ/ry1btpS5QCIv6P3335d/d8XSmNhqL2aQbILS29aIPvnkE0NERITB2dlZbqfftm1bheenTZtmCA8Pl1vrSRtM26cvvY0bN67S87l9Xv0q+32K25w5c8znTJ8+/ZrnkPZ+r0eOHDGMGDHCEBQUZHB3dze0a9fusu30Wsamq0RERKRbzBEiIiIi3WIgRERERLrFQIiIiIh0i4EQERER6RYDISIiItItBkJERESkWwyEiIiISLcYCBEREZFuMRAiIiIi3WIgRERERLrFQIiIiIh0i4EQERER6RYDISIiItItBkJERESkWwyEiIiISLcYCBEREZFuMRAiIiIi3WIgRERERLrFQIiIiIh0i4EQERER6RYDISIiItItBkJERESkWwyEiIiISLcYCBEREZFu6TYQ2rp1KxwcHDB06FClh0JEREQKsTMYDAbo0IMPPghPT0/873//Q1xcHMLCwpQeEhEREVmZLmeEsrOzsWDBAjz22GNyRuj77783PyeOfX19K5y/dOlS2NnZVXjszTffRFBQELy8vGRQ9fzzz6NDhw5W+x6IiIio9nQZCC1cuBAtW7ZEixYtcM899+C7775DdSbG5s6di7feegvvvvsudu/ejYiICHzxxRcWHTMRERHVPV0GQmI5TARAwpAhQ5CRkYENGzZU+fWffPIJxo8fjwceeADNmzfHK6+8grZt21pwxERERGQJuguERD7Qjh07MHr0aHnf0dERd911lwyOqnONbt26VXjs0vtERESkfo7QGRHwFBcXV0iOFstiLi4u+PTTT2Fvb3/ZMllRUZECIyUiIiJL09WMkAiAfvzxR3zwwQfYt2+f+bZ//34ZGP3yyy8IDAxEVlYWcnJyzK8T55Qncot27txZ4bFL7xMREZH66WpGaNmyZbh48aLM7/Hx8anw3B133CFni/755x+4u7vjhRdewBNPPIHt27dX2FUmTJo0CQ899BC6dOmCXr16yR1oBw4cQGRkpJW/IyIiIqoNXdURGjZsGEpLS/HXX39d9pzIG+revbucHTpx4gSmTp2Kc+fO4YYbbsCtt96Khx9+uMKS2RtvvIGPP/4Y+fn5GDVqlKxJJK4hCjUSERGRNugqELKkG2+8ESEhIfjpp5+UHgoRERFVka6WxupKbm4uvvzySwwePFi26RC5RatXr8aqVauUHhoRERFVA2eEaiAvL08us+3du1cujYnk6ZdeegkjRoxQemhERERUDQyEiIiISLd0tX2eiIiIqDwGQkRERKRbNh8IzZgxA127dpVd4kW3+OHDh8sWGeWJPJ8JEybA399fboMXNYWSk5PNz4st9aIlR3h4ONzc3NCqVSvMnj27wjU2bdqE6667Tl5DnCOaun700UdW+z6JiIio+mx+15hopiqCHBEMicrSolDioEGDcOjQIXh4eMhznnrqKVlbaNGiRbLQ4sSJE2Xi8+bNm+XzosO8CKJ+/vlnGQxt2bJF1hUSO8bEuYK4ljhu166dPBaB0SOPPCK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90UQ9OOPP+LLL79ETEwMnnrqKdxzzz3yvYjINrDpKhFpWnZ2Nvz9/fHzzz9j5MiR8rG0tDQ0aNAADz/8MGbNmnXZa3bt2oWuXbsiKytLziKJwEnMCl28eBG+vr7ynIKCAvj5+WH16tXo2bOn+bUPPvggcnNzMW/ePCt+l0RkKY4WuzIRkRUcP34chYWF6N69u/kxEcC0aNHCfH/37t149dVX5YyQCHbEkpdw5swZtG7dutLrHjt2TAY8N954Y4XHxXt17NjRYt8PEVkXAyEisvn8ocGDB8vb3LlzERgYKAMgcV8ENVebaRL++usv1K9fv8JzLi4uFh83EVkHAyEi0rQmTZrAyckJ27dvR0REhHxMzPocOXIE/fr1Q2xsLFJTU/HOO+/IfCDT0lh5zs7O8mtJSYn5MTFTJAIeETSJ6xCRbWIgRESaJnJ8xo8fLxOmRa5QUFAQXnzxRdjbG/eCiOBIBDqffPIJHn30UURHR8vE6fIaNmwod4stW7YMN998s9whJnaYPfPMMzJBWiyl9e7dGxkZGdi8eTO8vb0xbtw4hb5jIqpL3DVGRJo3c+ZM9OnTB8OGDcPAgQNl0NK5c2f5nFgK+/7777Fo0SI5yyNmht5///0KrxdLX6+99hqef/55BAcHY+LEifJxETC9/PLLcvdYq1atMGTIELlUJrbTE5Ft4K4xIiIi0i3OCBEREZFuMRAiIiIi3WIgRERERLrFQIiIiIh0i4EQERER6RYDISIiItItBkJERESkWwyEiIiISLcYCBEREZFuMRAiIiIi3WIgRERERLrFQIiIiIigV/8PMz+aSf5PSqMAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "result.portfolio.equity.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x22e4080e550>]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data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UgAu/uHCM5eXlkaGhIQ0ePJisrKxoyZIl6vOioqKobdu24s3VuHFjOnLkCNWqVYtWrlxJLi4upI+UGjviRtyIG3HLLW6lx14eFJMIFaVly5b07rvviuXG+c3E+A11/fp1OnnyJIWGhlJgYKC4X26UGjviRtyIG3HLLW6lx15qkkKFh4eL1TI1x0eLWl5cjpQaO+JG3IhbvpQat9JjLwuKqBHSpOoAO3ToEFlbW6vHR7/44guxhgKPn8qVUmNH3IibIW7ELTdKjr0sGZPCqBacOnbsGPXt25eCg4Ppvffeo7S0NFq+fDk5OzuTXCk1dsSNuBE34pYjJcdepiQF4r1V/Pz8JAMDA8nMzEyaNWuWpBRKjR1xI24lQNzKilvpsZcVxRZLv/LKK1S9enX67rvvxLLjSqLU2BE34lYCxK2suJUee1lQbCKUm5tLRkZGpERKjR1xKwviVhalxq302MuCYhMhAAAAAMXNGgMAAABQQSIEAAAAioVECAAAABQLiRAAAAAoFhIhAAAAUCwkQgAAAKBYSIQAAABAsZAIAQAAgGIhEQIAAADFQiIEAAAApFT/D4Jb/sfx0Y7uAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "chart = plt.subplot2grid((5, 2), (0, 0), rowspan=3, colspan=2)\n",
    "plt.xticks(rotation=30)\n",
    "chart.plot(result.portfolio.index, result.portfolio['market_value'])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>type</th>\n",
       "      <th>symbol</th>\n",
       "      <th>date</th>\n",
       "      <th>shares</th>\n",
       "      <th>limit_price</th>\n",
       "      <th>fill_price</th>\n",
       "      <th>fees</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>buy</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-02</td>\n",
       "      <td>20559</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12.08</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>buy</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-02</td>\n",
       "      <td>32894</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.51</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>sell</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-07</td>\n",
       "      <td>20559</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12.18</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>sell</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-07</td>\n",
       "      <td>32894</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.53</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>buy</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-08</td>\n",
       "      <td>20670</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12.10</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>buy</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-08</td>\n",
       "      <td>33425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.49</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>sell</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-11</td>\n",
       "      <td>20670</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12.08</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>sell</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-11</td>\n",
       "      <td>33425</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.34</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>buy</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-14</td>\n",
       "      <td>20911</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11.68</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>buy</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-14</td>\n",
       "      <td>34390</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.12</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>sell</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-17</td>\n",
       "      <td>20911</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11.58</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>sell</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-17</td>\n",
       "      <td>34390</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.10</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>buy</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-18</td>\n",
       "      <td>21370</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11.64</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>buy</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-18</td>\n",
       "      <td>34516</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.12</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>sell</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-23</td>\n",
       "      <td>21370</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11.33</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>sell</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-23</td>\n",
       "      <td>34516</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.04</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>buy</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-24</td>\n",
       "      <td>21560</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11.18</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>buy</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-24</td>\n",
       "      <td>34552</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.02</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>sell</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-29</td>\n",
       "      <td>21560</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11.31</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>sell</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-29</td>\n",
       "      <td>34552</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.12</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>buy</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-30</td>\n",
       "      <td>21723</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11.20</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>buy</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-30</td>\n",
       "      <td>34751</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.06</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    type  symbol       date  shares  limit_price  fill_price  fees\n",
       "id                                                                \n",
       "1    buy  000001 2023-08-02   20559          NaN       12.08   0.0\n",
       "2    buy  600000 2023-08-02   32894          NaN        7.51   0.0\n",
       "3   sell  000001 2023-08-07   20559          NaN       12.18   0.0\n",
       "4   sell  600000 2023-08-07   32894          NaN        7.53   0.0\n",
       "5    buy  000001 2023-08-08   20670          NaN       12.10   0.0\n",
       "6    buy  600000 2023-08-08   33425          NaN        7.49   0.0\n",
       "7   sell  000001 2023-08-11   20670          NaN       12.08   0.0\n",
       "8   sell  600000 2023-08-11   33425          NaN        7.34   0.0\n",
       "9    buy  000001 2023-08-14   20911          NaN       11.68   0.0\n",
       "10   buy  600000 2023-08-14   34390          NaN        7.12   0.0\n",
       "11  sell  000001 2023-08-17   20911          NaN       11.58   0.0\n",
       "12  sell  600000 2023-08-17   34390          NaN        7.10   0.0\n",
       "13   buy  000001 2023-08-18   21370          NaN       11.64   0.0\n",
       "14   buy  600000 2023-08-18   34516          NaN        7.12   0.0\n",
       "15  sell  000001 2023-08-23   21370          NaN       11.33   0.0\n",
       "16  sell  600000 2023-08-23   34516          NaN        7.04   0.0\n",
       "17   buy  000001 2023-08-24   21560          NaN       11.18   0.0\n",
       "18   buy  600000 2023-08-24   34552          NaN        7.02   0.0\n",
       "19  sell  000001 2023-08-29   21560          NaN       11.31   0.0\n",
       "20  sell  600000 2023-08-29   34552          NaN        7.12   0.0\n",
       "21   buy  000001 2023-08-30   21723          NaN       11.20   0.0\n",
       "22   buy  600000 2023-08-30   34751          NaN        7.06   0.0"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.orders"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cash</th>\n",
       "      <th>equity</th>\n",
       "      <th>margin</th>\n",
       "      <th>market_value</th>\n",
       "      <th>pnl</th>\n",
       "      <th>unrealized_pnl</th>\n",
       "      <th>fees</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2023-08-01</th>\n",
       "      <td>500000.00</td>\n",
       "      <td>500000.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>500000.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-02</th>\n",
       "      <td>4613.34</td>\n",
       "      <td>497985.23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>497985.23</td>\n",
       "      <td>-2014.77</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-03</th>\n",
       "      <td>4613.34</td>\n",
       "      <td>506784.45</td>\n",
       "      <td>0.0</td>\n",
       "      <td>506784.45</td>\n",
       "      <td>6784.45</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-04</th>\n",
       "      <td>4613.34</td>\n",
       "      <td>506825.56</td>\n",
       "      <td>0.0</td>\n",
       "      <td>506825.56</td>\n",
       "      <td>6825.56</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-07</th>\n",
       "      <td>502713.78</td>\n",
       "      <td>502713.78</td>\n",
       "      <td>0.0</td>\n",
       "      <td>502713.78</td>\n",
       "      <td>2713.78</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-08</th>\n",
       "      <td>2253.53</td>\n",
       "      <td>503716.53</td>\n",
       "      <td>0.0</td>\n",
       "      <td>503716.53</td>\n",
       "      <td>3716.53</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-09</th>\n",
       "      <td>2253.53</td>\n",
       "      <td>506166.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>506166.18</td>\n",
       "      <td>6166.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-10</th>\n",
       "      <td>2253.53</td>\n",
       "      <td>501614.23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>501614.23</td>\n",
       "      <td>1614.23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-11</th>\n",
       "      <td>497286.63</td>\n",
       "      <td>497286.63</td>\n",
       "      <td>0.0</td>\n",
       "      <td>497286.63</td>\n",
       "      <td>-2713.37</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-14</th>\n",
       "      <td>8189.35</td>\n",
       "      <td>496389.72</td>\n",
       "      <td>0.0</td>\n",
       "      <td>496389.72</td>\n",
       "      <td>-3610.28</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-15</th>\n",
       "      <td>8189.35</td>\n",
       "      <td>500051.68</td>\n",
       "      <td>0.0</td>\n",
       "      <td>500051.68</td>\n",
       "      <td>51.68</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-16</th>\n",
       "      <td>8189.35</td>\n",
       "      <td>499019.98</td>\n",
       "      <td>0.0</td>\n",
       "      <td>499019.98</td>\n",
       "      <td>-980.02</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-17</th>\n",
       "      <td>494507.73</td>\n",
       "      <td>494507.73</td>\n",
       "      <td>0.0</td>\n",
       "      <td>494507.73</td>\n",
       "      <td>-5492.27</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-18</th>\n",
       "      <td>7.01</td>\n",
       "      <td>491072.33</td>\n",
       "      <td>0.0</td>\n",
       "      <td>491072.33</td>\n",
       "      <td>-8927.67</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-21</th>\n",
       "      <td>7.01</td>\n",
       "      <td>482146.77</td>\n",
       "      <td>0.0</td>\n",
       "      <td>482146.77</td>\n",
       "      <td>-17853.23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-22</th>\n",
       "      <td>7.01</td>\n",
       "      <td>484941.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>484941.07</td>\n",
       "      <td>-15058.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-23</th>\n",
       "      <td>485121.75</td>\n",
       "      <td>485121.75</td>\n",
       "      <td>0.0</td>\n",
       "      <td>485121.75</td>\n",
       "      <td>-14878.25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-24</th>\n",
       "      <td>1525.91</td>\n",
       "      <td>483007.19</td>\n",
       "      <td>0.0</td>\n",
       "      <td>483007.19</td>\n",
       "      <td>-16992.81</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-25</th>\n",
       "      <td>1525.91</td>\n",
       "      <td>487236.31</td>\n",
       "      <td>0.0</td>\n",
       "      <td>487236.31</td>\n",
       "      <td>-12763.69</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-28</th>\n",
       "      <td>1525.91</td>\n",
       "      <td>496943.91</td>\n",
       "      <td>0.0</td>\n",
       "      <td>496943.91</td>\n",
       "      <td>-3056.09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-29</th>\n",
       "      <td>491379.75</td>\n",
       "      <td>491379.75</td>\n",
       "      <td>0.0</td>\n",
       "      <td>491379.75</td>\n",
       "      <td>-8620.25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-08-30</th>\n",
       "      <td>2740.09</td>\n",
       "      <td>488816.61</td>\n",
       "      <td>0.0</td>\n",
       "      <td>488816.61</td>\n",
       "      <td>-11183.39</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 cash     equity  margin  market_value       pnl  \\\n",
       "date                                                               \n",
       "2023-08-01  500000.00  500000.00     0.0     500000.00      0.00   \n",
       "2023-08-02    4613.34  497985.23     0.0     497985.23  -2014.77   \n",
       "2023-08-03    4613.34  506784.45     0.0     506784.45   6784.45   \n",
       "2023-08-04    4613.34  506825.56     0.0     506825.56   6825.56   \n",
       "2023-08-07  502713.78  502713.78     0.0     502713.78   2713.78   \n",
       "2023-08-08    2253.53  503716.53     0.0     503716.53   3716.53   \n",
       "2023-08-09    2253.53  506166.18     0.0     506166.18   6166.18   \n",
       "2023-08-10    2253.53  501614.23     0.0     501614.23   1614.23   \n",
       "2023-08-11  497286.63  497286.63     0.0     497286.63  -2713.37   \n",
       "2023-08-14    8189.35  496389.72     0.0     496389.72  -3610.28   \n",
       "2023-08-15    8189.35  500051.68     0.0     500051.68     51.68   \n",
       "2023-08-16    8189.35  499019.98     0.0     499019.98   -980.02   \n",
       "2023-08-17  494507.73  494507.73     0.0     494507.73  -5492.27   \n",
       "2023-08-18       7.01  491072.33     0.0     491072.33  -8927.67   \n",
       "2023-08-21       7.01  482146.77     0.0     482146.77 -17853.23   \n",
       "2023-08-22       7.01  484941.07     0.0     484941.07 -15058.93   \n",
       "2023-08-23  485121.75  485121.75     0.0     485121.75 -14878.25   \n",
       "2023-08-24    1525.91  483007.19     0.0     483007.19 -16992.81   \n",
       "2023-08-25    1525.91  487236.31     0.0     487236.31 -12763.69   \n",
       "2023-08-28    1525.91  496943.91     0.0     496943.91  -3056.09   \n",
       "2023-08-29  491379.75  491379.75     0.0     491379.75  -8620.25   \n",
       "2023-08-30    2740.09  488816.61     0.0     488816.61 -11183.39   \n",
       "\n",
       "            unrealized_pnl  fees  \n",
       "date                              \n",
       "2023-08-01             0.0   0.0  \n",
       "2023-08-02             0.0   0.0  \n",
       "2023-08-03             0.0   0.0  \n",
       "2023-08-04             0.0   0.0  \n",
       "2023-08-07             0.0   0.0  \n",
       "2023-08-08             0.0   0.0  \n",
       "2023-08-09             0.0   0.0  \n",
       "2023-08-10             0.0   0.0  \n",
       "2023-08-11             0.0   0.0  \n",
       "2023-08-14             0.0   0.0  \n",
       "2023-08-15             0.0   0.0  \n",
       "2023-08-16             0.0   0.0  \n",
       "2023-08-17             0.0   0.0  \n",
       "2023-08-18             0.0   0.0  \n",
       "2023-08-21             0.0   0.0  \n",
       "2023-08-22             0.0   0.0  \n",
       "2023-08-23             0.0   0.0  \n",
       "2023-08-24             0.0   0.0  \n",
       "2023-08-25             0.0   0.0  \n",
       "2023-08-28             0.0   0.0  \n",
       "2023-08-29             0.0   0.0  \n",
       "2023-08-30             0.0   0.0  "
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.portfolio"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>long_shares</th>\n",
       "      <th>short_shares</th>\n",
       "      <th>close</th>\n",
       "      <th>equity</th>\n",
       "      <th>market_value</th>\n",
       "      <th>margin</th>\n",
       "      <th>unrealized_pnl</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>symbol</th>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-02</th>\n",
       "      <td>20559</td>\n",
       "      <td>0</td>\n",
       "      <td>12.03</td>\n",
       "      <td>247324.77</td>\n",
       "      <td>247324.77</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1027.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-02</th>\n",
       "      <td>32894</td>\n",
       "      <td>0</td>\n",
       "      <td>7.48</td>\n",
       "      <td>246047.12</td>\n",
       "      <td>246047.12</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-986.82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-03</th>\n",
       "      <td>20559</td>\n",
       "      <td>0</td>\n",
       "      <td>12.33</td>\n",
       "      <td>253492.47</td>\n",
       "      <td>253492.47</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5139.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-03</th>\n",
       "      <td>32894</td>\n",
       "      <td>0</td>\n",
       "      <td>7.56</td>\n",
       "      <td>248678.64</td>\n",
       "      <td>248678.64</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1644.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-04</th>\n",
       "      <td>20559</td>\n",
       "      <td>0</td>\n",
       "      <td>12.30</td>\n",
       "      <td>252875.70</td>\n",
       "      <td>252875.70</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4522.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-04</th>\n",
       "      <td>32894</td>\n",
       "      <td>0</td>\n",
       "      <td>7.58</td>\n",
       "      <td>249336.52</td>\n",
       "      <td>249336.52</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2302.58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-08</th>\n",
       "      <td>20670</td>\n",
       "      <td>0</td>\n",
       "      <td>12.10</td>\n",
       "      <td>250107.00</td>\n",
       "      <td>250107.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-08</th>\n",
       "      <td>33425</td>\n",
       "      <td>0</td>\n",
       "      <td>7.52</td>\n",
       "      <td>251356.00</td>\n",
       "      <td>251356.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1002.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-09</th>\n",
       "      <td>20670</td>\n",
       "      <td>0</td>\n",
       "      <td>12.17</td>\n",
       "      <td>251553.90</td>\n",
       "      <td>251553.90</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1446.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-09</th>\n",
       "      <td>33425</td>\n",
       "      <td>0</td>\n",
       "      <td>7.55</td>\n",
       "      <td>252358.75</td>\n",
       "      <td>252358.75</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2005.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-10</th>\n",
       "      <td>20670</td>\n",
       "      <td>0</td>\n",
       "      <td>12.16</td>\n",
       "      <td>251347.20</td>\n",
       "      <td>251347.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1240.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-10</th>\n",
       "      <td>33425</td>\n",
       "      <td>0</td>\n",
       "      <td>7.42</td>\n",
       "      <td>248013.50</td>\n",
       "      <td>248013.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-2339.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-14</th>\n",
       "      <td>20911</td>\n",
       "      <td>0</td>\n",
       "      <td>11.67</td>\n",
       "      <td>244031.37</td>\n",
       "      <td>244031.37</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-209.11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-14</th>\n",
       "      <td>34390</td>\n",
       "      <td>0</td>\n",
       "      <td>7.10</td>\n",
       "      <td>244169.00</td>\n",
       "      <td>244169.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-687.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-15</th>\n",
       "      <td>20911</td>\n",
       "      <td>0</td>\n",
       "      <td>11.73</td>\n",
       "      <td>245286.03</td>\n",
       "      <td>245286.03</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1045.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-15</th>\n",
       "      <td>34390</td>\n",
       "      <td>0</td>\n",
       "      <td>7.17</td>\n",
       "      <td>246576.30</td>\n",
       "      <td>246576.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1719.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-16</th>\n",
       "      <td>20911</td>\n",
       "      <td>0</td>\n",
       "      <td>11.73</td>\n",
       "      <td>245286.03</td>\n",
       "      <td>245286.03</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1045.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-16</th>\n",
       "      <td>34390</td>\n",
       "      <td>0</td>\n",
       "      <td>7.14</td>\n",
       "      <td>245544.60</td>\n",
       "      <td>245544.60</td>\n",
       "      <td>0.0</td>\n",
       "      <td>687.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-18</th>\n",
       "      <td>21370</td>\n",
       "      <td>0</td>\n",
       "      <td>11.56</td>\n",
       "      <td>247037.20</td>\n",
       "      <td>247037.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1709.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-18</th>\n",
       "      <td>34516</td>\n",
       "      <td>0</td>\n",
       "      <td>7.07</td>\n",
       "      <td>244028.12</td>\n",
       "      <td>244028.12</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1725.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-21</th>\n",
       "      <td>21370</td>\n",
       "      <td>0</td>\n",
       "      <td>11.32</td>\n",
       "      <td>241908.40</td>\n",
       "      <td>241908.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-6838.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-21</th>\n",
       "      <td>34516</td>\n",
       "      <td>0</td>\n",
       "      <td>6.96</td>\n",
       "      <td>240231.36</td>\n",
       "      <td>240231.36</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-5522.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-22</th>\n",
       "      <td>21370</td>\n",
       "      <td>0</td>\n",
       "      <td>11.37</td>\n",
       "      <td>242976.90</td>\n",
       "      <td>242976.90</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-5769.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-22</th>\n",
       "      <td>34516</td>\n",
       "      <td>0</td>\n",
       "      <td>7.01</td>\n",
       "      <td>241957.16</td>\n",
       "      <td>241957.16</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-3796.76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-24</th>\n",
       "      <td>21560</td>\n",
       "      <td>0</td>\n",
       "      <td>11.13</td>\n",
       "      <td>239962.80</td>\n",
       "      <td>239962.80</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1078.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-24</th>\n",
       "      <td>34552</td>\n",
       "      <td>0</td>\n",
       "      <td>6.99</td>\n",
       "      <td>241518.48</td>\n",
       "      <td>241518.48</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1036.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-25</th>\n",
       "      <td>21560</td>\n",
       "      <td>0</td>\n",
       "      <td>11.23</td>\n",
       "      <td>242118.80</td>\n",
       "      <td>242118.80</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1078.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-25</th>\n",
       "      <td>34552</td>\n",
       "      <td>0</td>\n",
       "      <td>7.05</td>\n",
       "      <td>243591.60</td>\n",
       "      <td>243591.60</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1036.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-28</th>\n",
       "      <td>21560</td>\n",
       "      <td>0</td>\n",
       "      <td>11.52</td>\n",
       "      <td>248371.20</td>\n",
       "      <td>248371.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7330.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-28</th>\n",
       "      <td>34552</td>\n",
       "      <td>0</td>\n",
       "      <td>7.15</td>\n",
       "      <td>247046.80</td>\n",
       "      <td>247046.80</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4491.76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001</th>\n",
       "      <th>2023-08-30</th>\n",
       "      <td>21723</td>\n",
       "      <td>0</td>\n",
       "      <td>11.13</td>\n",
       "      <td>241776.99</td>\n",
       "      <td>241776.99</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1520.61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600000</th>\n",
       "      <th>2023-08-30</th>\n",
       "      <td>34751</td>\n",
       "      <td>0</td>\n",
       "      <td>7.03</td>\n",
       "      <td>244299.53</td>\n",
       "      <td>244299.53</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1042.53</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   long_shares  short_shares  close     equity  market_value  \\\n",
       "symbol date                                                                    \n",
       "000001 2023-08-02        20559             0  12.03  247324.77     247324.77   \n",
       "600000 2023-08-02        32894             0   7.48  246047.12     246047.12   \n",
       "000001 2023-08-03        20559             0  12.33  253492.47     253492.47   \n",
       "600000 2023-08-03        32894             0   7.56  248678.64     248678.64   \n",
       "000001 2023-08-04        20559             0  12.30  252875.70     252875.70   \n",
       "600000 2023-08-04        32894             0   7.58  249336.52     249336.52   \n",
       "000001 2023-08-08        20670             0  12.10  250107.00     250107.00   \n",
       "600000 2023-08-08        33425             0   7.52  251356.00     251356.00   \n",
       "000001 2023-08-09        20670             0  12.17  251553.90     251553.90   \n",
       "600000 2023-08-09        33425             0   7.55  252358.75     252358.75   \n",
       "000001 2023-08-10        20670             0  12.16  251347.20     251347.20   \n",
       "600000 2023-08-10        33425             0   7.42  248013.50     248013.50   \n",
       "000001 2023-08-14        20911             0  11.67  244031.37     244031.37   \n",
       "600000 2023-08-14        34390             0   7.10  244169.00     244169.00   \n",
       "000001 2023-08-15        20911             0  11.73  245286.03     245286.03   \n",
       "600000 2023-08-15        34390             0   7.17  246576.30     246576.30   \n",
       "000001 2023-08-16        20911             0  11.73  245286.03     245286.03   \n",
       "600000 2023-08-16        34390             0   7.14  245544.60     245544.60   \n",
       "000001 2023-08-18        21370             0  11.56  247037.20     247037.20   \n",
       "600000 2023-08-18        34516             0   7.07  244028.12     244028.12   \n",
       "000001 2023-08-21        21370             0  11.32  241908.40     241908.40   \n",
       "600000 2023-08-21        34516             0   6.96  240231.36     240231.36   \n",
       "000001 2023-08-22        21370             0  11.37  242976.90     242976.90   \n",
       "600000 2023-08-22        34516             0   7.01  241957.16     241957.16   \n",
       "000001 2023-08-24        21560             0  11.13  239962.80     239962.80   \n",
       "600000 2023-08-24        34552             0   6.99  241518.48     241518.48   \n",
       "000001 2023-08-25        21560             0  11.23  242118.80     242118.80   \n",
       "600000 2023-08-25        34552             0   7.05  243591.60     243591.60   \n",
       "000001 2023-08-28        21560             0  11.52  248371.20     248371.20   \n",
       "600000 2023-08-28        34552             0   7.15  247046.80     247046.80   \n",
       "000001 2023-08-30        21723             0  11.13  241776.99     241776.99   \n",
       "600000 2023-08-30        34751             0   7.03  244299.53     244299.53   \n",
       "\n",
       "                   margin  unrealized_pnl  \n",
       "symbol date                                \n",
       "000001 2023-08-02     0.0        -1027.95  \n",
       "600000 2023-08-02     0.0         -986.82  \n",
       "000001 2023-08-03     0.0         5139.75  \n",
       "600000 2023-08-03     0.0         1644.70  \n",
       "000001 2023-08-04     0.0         4522.98  \n",
       "600000 2023-08-04     0.0         2302.58  \n",
       "000001 2023-08-08     0.0            0.00  \n",
       "600000 2023-08-08     0.0         1002.75  \n",
       "000001 2023-08-09     0.0         1446.90  \n",
       "600000 2023-08-09     0.0         2005.50  \n",
       "000001 2023-08-10     0.0         1240.20  \n",
       "600000 2023-08-10     0.0        -2339.75  \n",
       "000001 2023-08-14     0.0         -209.11  \n",
       "600000 2023-08-14     0.0         -687.80  \n",
       "000001 2023-08-15     0.0         1045.55  \n",
       "600000 2023-08-15     0.0         1719.50  \n",
       "000001 2023-08-16     0.0         1045.55  \n",
       "600000 2023-08-16     0.0          687.80  \n",
       "000001 2023-08-18     0.0        -1709.60  \n",
       "600000 2023-08-18     0.0        -1725.80  \n",
       "000001 2023-08-21     0.0        -6838.40  \n",
       "600000 2023-08-21     0.0        -5522.56  \n",
       "000001 2023-08-22     0.0        -5769.90  \n",
       "600000 2023-08-22     0.0        -3796.76  \n",
       "000001 2023-08-24     0.0        -1078.00  \n",
       "600000 2023-08-24     0.0        -1036.56  \n",
       "000001 2023-08-25     0.0         1078.00  \n",
       "600000 2023-08-25     0.0         1036.56  \n",
       "000001 2023-08-28     0.0         7330.40  \n",
       "600000 2023-08-28     0.0         4491.76  \n",
       "000001 2023-08-30     0.0        -1520.61  \n",
       "600000 2023-08-30     0.0        -1042.53  "
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.positions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>type</th>\n",
       "      <th>symbol</th>\n",
       "      <th>entry_date</th>\n",
       "      <th>exit_date</th>\n",
       "      <th>entry</th>\n",
       "      <th>exit</th>\n",
       "      <th>shares</th>\n",
       "      <th>pnl</th>\n",
       "      <th>return_pct</th>\n",
       "      <th>agg_pnl</th>\n",
       "      <th>bars</th>\n",
       "      <th>pnl_per_bar</th>\n",
       "      <th>stop</th>\n",
       "      <th>mae</th>\n",
       "      <th>mfe</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>long</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-02</td>\n",
       "      <td>2023-08-07</td>\n",
       "      <td>12.08</td>\n",
       "      <td>12.18</td>\n",
       "      <td>20559</td>\n",
       "      <td>2055.90</td>\n",
       "      <td>0.83</td>\n",
       "      <td>2055.90</td>\n",
       "      <td>3</td>\n",
       "      <td>685.30</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.15</td>\n",
       "      <td>0.45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>long</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-02</td>\n",
       "      <td>2023-08-07</td>\n",
       "      <td>7.51</td>\n",
       "      <td>7.53</td>\n",
       "      <td>32894</td>\n",
       "      <td>657.88</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2713.78</td>\n",
       "      <td>3</td>\n",
       "      <td>219.29</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>0.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>long</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-08</td>\n",
       "      <td>2023-08-11</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.08</td>\n",
       "      <td>20670</td>\n",
       "      <td>-413.40</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>2300.38</td>\n",
       "      <td>3</td>\n",
       "      <td>-137.80</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>0.11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>long</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-08</td>\n",
       "      <td>2023-08-11</td>\n",
       "      <td>7.49</td>\n",
       "      <td>7.34</td>\n",
       "      <td>33425</td>\n",
       "      <td>-5013.75</td>\n",
       "      <td>-2.00</td>\n",
       "      <td>-2713.37</td>\n",
       "      <td>3</td>\n",
       "      <td>-1671.25</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.15</td>\n",
       "      <td>0.06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>long</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-14</td>\n",
       "      <td>2023-08-17</td>\n",
       "      <td>11.68</td>\n",
       "      <td>11.58</td>\n",
       "      <td>20911</td>\n",
       "      <td>-2091.10</td>\n",
       "      <td>-0.86</td>\n",
       "      <td>-4804.47</td>\n",
       "      <td>3</td>\n",
       "      <td>-697.03</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>0.17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>long</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-14</td>\n",
       "      <td>2023-08-17</td>\n",
       "      <td>7.12</td>\n",
       "      <td>7.10</td>\n",
       "      <td>34390</td>\n",
       "      <td>-687.80</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-5492.27</td>\n",
       "      <td>3</td>\n",
       "      <td>-229.27</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.07</td>\n",
       "      <td>0.08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>long</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-18</td>\n",
       "      <td>2023-08-23</td>\n",
       "      <td>11.64</td>\n",
       "      <td>11.33</td>\n",
       "      <td>21370</td>\n",
       "      <td>-6624.70</td>\n",
       "      <td>-2.66</td>\n",
       "      <td>-12116.97</td>\n",
       "      <td>3</td>\n",
       "      <td>-2208.23</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.33</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>long</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-18</td>\n",
       "      <td>2023-08-23</td>\n",
       "      <td>7.12</td>\n",
       "      <td>7.04</td>\n",
       "      <td>34516</td>\n",
       "      <td>-2761.28</td>\n",
       "      <td>-1.12</td>\n",
       "      <td>-14878.25</td>\n",
       "      <td>3</td>\n",
       "      <td>-920.43</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>long</td>\n",
       "      <td>000001</td>\n",
       "      <td>2023-08-24</td>\n",
       "      <td>2023-08-29</td>\n",
       "      <td>11.18</td>\n",
       "      <td>11.31</td>\n",
       "      <td>21560</td>\n",
       "      <td>2802.80</td>\n",
       "      <td>1.16</td>\n",
       "      <td>-12075.45</td>\n",
       "      <td>3</td>\n",
       "      <td>934.27</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.13</td>\n",
       "      <td>0.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>long</td>\n",
       "      <td>600000</td>\n",
       "      <td>2023-08-24</td>\n",
       "      <td>2023-08-29</td>\n",
       "      <td>7.02</td>\n",
       "      <td>7.12</td>\n",
       "      <td>34552</td>\n",
       "      <td>3455.20</td>\n",
       "      <td>1.42</td>\n",
       "      <td>-8620.25</td>\n",
       "      <td>3</td>\n",
       "      <td>1151.73</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>0.30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    type  symbol entry_date  exit_date  entry   exit  shares      pnl  \\\n",
       "id                                                                      \n",
       "1   long  000001 2023-08-02 2023-08-07  12.08  12.18   20559  2055.90   \n",
       "2   long  600000 2023-08-02 2023-08-07   7.51   7.53   32894   657.88   \n",
       "3   long  000001 2023-08-08 2023-08-11  12.10  12.08   20670  -413.40   \n",
       "4   long  600000 2023-08-08 2023-08-11   7.49   7.34   33425 -5013.75   \n",
       "5   long  000001 2023-08-14 2023-08-17  11.68  11.58   20911 -2091.10   \n",
       "6   long  600000 2023-08-14 2023-08-17   7.12   7.10   34390  -687.80   \n",
       "7   long  000001 2023-08-18 2023-08-23  11.64  11.33   21370 -6624.70   \n",
       "8   long  600000 2023-08-18 2023-08-23   7.12   7.04   34516 -2761.28   \n",
       "9   long  000001 2023-08-24 2023-08-29  11.18  11.31   21560  2802.80   \n",
       "10  long  600000 2023-08-24 2023-08-29   7.02   7.12   34552  3455.20   \n",
       "\n",
       "    return_pct   agg_pnl  bars  pnl_per_bar stop   mae   mfe  \n",
       "id                                                            \n",
       "1         0.83   2055.90     3       685.30  bar -0.15  0.45  \n",
       "2         0.27   2713.78     3       219.29  bar -0.08  0.14  \n",
       "3        -0.17   2300.38     3      -137.80  bar -0.10  0.11  \n",
       "4        -2.00  -2713.37     3     -1671.25  bar -0.15  0.06  \n",
       "5        -0.86  -4804.47     3      -697.03  bar -0.10  0.17  \n",
       "6        -0.28  -5492.27     3      -229.27  bar -0.07  0.08  \n",
       "7        -2.66 -12116.97     3     -2208.23  bar -0.33  0.10  \n",
       "8        -1.12 -14878.25     3      -920.43  bar -0.16  0.05  \n",
       "9         1.16 -12075.45     3       934.27  bar -0.13  0.75  \n",
       "10        1.42  -8620.25     3      1151.73  bar -0.05  0.30  "
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.trades"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>value</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>trade_count</td>\n",
       "      <td>10.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>initial_market_value</td>\n",
       "      <td>500000.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>end_market_value</td>\n",
       "      <td>488816.610000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>total_pnl</td>\n",
       "      <td>-8620.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>unrealized_pnl</td>\n",
       "      <td>-2563.140000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>total_return_pct</td>\n",
       "      <td>-1.724050</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>total_profit</td>\n",
       "      <td>8971.780000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>total_loss</td>\n",
       "      <td>-17592.030000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>total_fees</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>max_drawdown</td>\n",
       "      <td>-24678.790000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>max_drawdown_pct</td>\n",
       "      <td>-4.869287</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>win_rate</td>\n",
       "      <td>40.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>loss_rate</td>\n",
       "      <td>60.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>winning_trades</td>\n",
       "      <td>4.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>losing_trades</td>\n",
       "      <td>6.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>avg_pnl</td>\n",
       "      <td>-862.025000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>avg_return_pct</td>\n",
       "      <td>-0.341000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>avg_trade_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>avg_profit</td>\n",
       "      <td>2242.945000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>avg_profit_pct</td>\n",
       "      <td>0.920000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>avg_winning_trade_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>avg_loss</td>\n",
       "      <td>-2932.005000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>avg_loss_pct</td>\n",
       "      <td>-1.181667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>avg_losing_trade_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>largest_win</td>\n",
       "      <td>3455.200000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>largest_win_pct</td>\n",
       "      <td>1.420000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>largest_win_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>largest_loss</td>\n",
       "      <td>-6624.700000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>largest_loss_pct</td>\n",
       "      <td>-2.660000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>largest_loss_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>max_wins</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>max_losses</td>\n",
       "      <td>6.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>sharpe</td>\n",
       "      <td>-0.117967</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>sortino</td>\n",
       "      <td>-0.250087</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>profit_factor</td>\n",
       "      <td>0.746119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>ulcer_index</td>\n",
       "      <td>3.617931</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>upi</td>\n",
       "      <td>-0.028605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>equity_r2</td>\n",
       "      <td>0.591262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>std_error</td>\n",
       "      <td>7674.257024</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      name          value\n",
       "0              trade_count      10.000000\n",
       "1     initial_market_value  500000.000000\n",
       "2         end_market_value  488816.610000\n",
       "3                total_pnl   -8620.250000\n",
       "4           unrealized_pnl   -2563.140000\n",
       "5         total_return_pct      -1.724050\n",
       "6             total_profit    8971.780000\n",
       "7               total_loss  -17592.030000\n",
       "8               total_fees       0.000000\n",
       "9             max_drawdown  -24678.790000\n",
       "10        max_drawdown_pct      -4.869287\n",
       "11                win_rate      40.000000\n",
       "12               loss_rate      60.000000\n",
       "13          winning_trades       4.000000\n",
       "14           losing_trades       6.000000\n",
       "15                 avg_pnl    -862.025000\n",
       "16          avg_return_pct      -0.341000\n",
       "17          avg_trade_bars       3.000000\n",
       "18              avg_profit    2242.945000\n",
       "19          avg_profit_pct       0.920000\n",
       "20  avg_winning_trade_bars       3.000000\n",
       "21                avg_loss   -2932.005000\n",
       "22            avg_loss_pct      -1.181667\n",
       "23   avg_losing_trade_bars       3.000000\n",
       "24             largest_win    3455.200000\n",
       "25         largest_win_pct       1.420000\n",
       "26        largest_win_bars       3.000000\n",
       "27            largest_loss   -6624.700000\n",
       "28        largest_loss_pct      -2.660000\n",
       "29       largest_loss_bars       3.000000\n",
       "30                max_wins       2.000000\n",
       "31              max_losses       6.000000\n",
       "32                  sharpe      -0.117967\n",
       "33                 sortino      -0.250087\n",
       "34           profit_factor       0.746119\n",
       "35             ulcer_index       3.617931\n",
       "36                     upi      -0.028605\n",
       "37               equity_r2       0.591262\n",
       "38               std_error    7674.257024"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.metrics_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### classwork1\n",
    "\n",
    "设定，时间2023年整年，初始金额1000000，编写如下策略：\n",
    "\n",
    "\n",
    "* 导入002594 比亚迪单个股票数据，一开始就购买一直持有到最后\n",
    "\n",
    "* 导入002594 比亚迪和'000001' 股票数据，一开始就购买各50%，每次持有2天 \n",
    "\n",
    "查看策略的收益曲线与各项指标\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Position对象 解读\n",
    "\n",
    "```python\n",
    "print(pos = ctx.long_pos())\n",
    "\n",
    "Position(symbol='000001', shares=Decimal('41118'), type='long', close=Decimal('12.33'), equity=Decimal('506984.94'), market_value=Decimal('506984.94'), margin=Decimal('0'), pnl=Decimal('10279.50'), entries=deque([Entry(id=1, date=numpy.datetime64('2023-08-02T00:00:00.000000000'), symbol='000001', shares=Decimal('41118'), price=Decimal('12.08'), type='long', bars=1, stops=[Stop(id=63, symbol='000001', stop_type=<StopType.BAR: 'bar'>, pos_type='long', percent=None, points=None, bars=3, fill_price=<PriceType.MIDDLE: 'middle'>, limit_price=None, exit_price=None)], mae=Decimal('-0.15'), mfe=Decimal('0.29'))]), bars=1) \n",
    "```\n",
    "\n",
    "这个对象是 `Position` 类的一个实例，`Position` 类用于表示一个未平仓的持仓信息。下面我们来详细解读这个对象的各个属性：\n",
    "\n",
    "### 整体信息\n",
    "这是一个关于股票代码为 `000001` 的多头持仓信息，包含了持仓的基本情况、成本、收益等信息。\n",
    "\n",
    "### 具体属性解读\n",
    "\n",
    "#### 1. 基础信息\n",
    "- `symbol='000001'`：表示持仓的股票代码为 `000001`。\n",
    "- `shares=Decimal('41118')`：表示持有的该股票的数量为 41118 股，使用 `Decimal` 类型是为了更精确地处理小数。\n",
    "- `type='long'`：表示持仓类型为多头，即买入并持有股票，期望股票价格上涨获利。\n",
    "\n",
    "#### 2. 价格与价值信息\n",
    "- `close=Decimal('12.33')`：表示该股票的最新收盘价为 12.33 元。\n",
    "- `equity=Decimal('506984.94')`：表示该持仓的权益价值，即当前持仓的总价值，计算方式为持仓数量乘以收盘价，$41118 \\times 12.33 = 506984.94$。\n",
    "- `market_value=Decimal('506984.94')`：表示该持仓的市场价值，在这个例子中与权益价值相等。\n",
    "- `margin=Decimal('0')`：表示该持仓使用的保证金为 0，可能是全额现金买入，没有使用杠杆。\n",
    "\n",
    "#### 3. 盈亏信息\n",
    "- `pnl=Decimal('10279.50')`：表示该持仓的未实现盈亏，即当前持仓相对于买入成本的盈利金额。\n",
    "\n",
    "#### 4. 持仓记录信息\n",
    "- `entries=deque([Entry(...)])`：这是一个双端队列，包含了该持仓的所有入场记录。在这个例子中，只有一个入场记录：\n",
    "  - `id=1`：入场记录的唯一标识符。\n",
    "  - `date=numpy.datetime64('2023-08-02T00:00:00.000000000')`：表示入场日期为 2023 年 8 月 2 日。\n",
    "  - `symbol='00001'`：股票代码。\n",
    "  - `shares=Decimal('41118')`：入场时买入的股票数量。\n",
    "  - `price=Decimal('12.08')`：入场时的买入价格。\n",
    "  - `type='long'`：入场类型为多头。\n",
    "  - `bars=1`：表示从入场到当前经过的周期数为 1。\n",
    "  - `stops=[Stop(...)]`：这是一个止损或止盈策略列表，在这个例子中只有一个止损策略：\n",
    "    - `id=63`：止损策略的唯一标识符。\n",
    "    - `symbol='000001'`：股票代码。\n",
    "    - `stop_type=<StopType.BAR: 'bar'>`：止损类型为按周期数止损，即经过一定周期后平仓。\n",
    "    - `pos_type='long'`：适用于多头持仓。\n",
    "    - `percent=None`：没有设置按百分比止损。\n",
    "    - `points=None`：没有设置按点数止损。\n",
    "    - `bars=3`：表示经过 3 个周期后触发止损。\n",
    "    - `fill_price=<PriceType.MIDDLE: 'middle'>`：止损时的成交价格类型为中间价。\n",
    "    - `limit_price=None`：没有设置限价。\n",
    "    - `exit_price=None`：目前还没有触发止损，所以没有退出价格。\n",
    "  - `mae=Decimal('-0.15')`：最大不利偏移，即从入场到当前，股票价格相对于入场价格的最大下跌幅度为 0.15 元。\n",
    "  - `mfe=Decimal('0.29')`：最大有利偏移，即从入场到当前，股票价格相对于入场价格的最大上涨幅度为 0.29 元。\n",
    "\n",
    "#### 5. 持仓周期信息\n",
    "- `bars=1`：表示从该持仓建立到当前经过的周期数为 1。\n",
    "\n",
    "综上所述，这个 `Position` 对象描述了一个在 2023 年 8 月 2 日以 12.08 元的价格买入 41118 股股票代码为 `000001` 的多头持仓，当前收盘价为 12.33 元，盈利 10279.50 元，设置了一个经过 3 个周期后触发的止损策略。 "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## metrics_df对象解读"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>value</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>trade_count</td>\n",
       "      <td>10.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>initial_market_value</td>\n",
       "      <td>500000.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>end_market_value</td>\n",
       "      <td>488816.610000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>total_pnl</td>\n",
       "      <td>-8620.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>unrealized_pnl</td>\n",
       "      <td>-2563.140000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>total_return_pct</td>\n",
       "      <td>-1.724050</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>total_profit</td>\n",
       "      <td>8971.780000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>total_loss</td>\n",
       "      <td>-17592.030000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>total_fees</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>max_drawdown</td>\n",
       "      <td>-24678.790000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>max_drawdown_pct</td>\n",
       "      <td>-4.869287</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>win_rate</td>\n",
       "      <td>40.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>loss_rate</td>\n",
       "      <td>60.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>winning_trades</td>\n",
       "      <td>4.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>losing_trades</td>\n",
       "      <td>6.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>avg_pnl</td>\n",
       "      <td>-862.025000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>avg_return_pct</td>\n",
       "      <td>-0.341000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>avg_trade_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>avg_profit</td>\n",
       "      <td>2242.945000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>avg_profit_pct</td>\n",
       "      <td>0.920000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>avg_winning_trade_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>avg_loss</td>\n",
       "      <td>-2932.005000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>avg_loss_pct</td>\n",
       "      <td>-1.181667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>avg_losing_trade_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>largest_win</td>\n",
       "      <td>3455.200000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>largest_win_pct</td>\n",
       "      <td>1.420000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>largest_win_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>largest_loss</td>\n",
       "      <td>-6624.700000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>largest_loss_pct</td>\n",
       "      <td>-2.660000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>largest_loss_bars</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>max_wins</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>max_losses</td>\n",
       "      <td>6.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>sharpe</td>\n",
       "      <td>-0.117967</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>sortino</td>\n",
       "      <td>-0.250087</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>profit_factor</td>\n",
       "      <td>0.746119</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>ulcer_index</td>\n",
       "      <td>3.617931</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>upi</td>\n",
       "      <td>-0.028605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>equity_r2</td>\n",
       "      <td>0.591262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>std_error</td>\n",
       "      <td>7674.257024</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      name          value\n",
       "0              trade_count      10.000000\n",
       "1     initial_market_value  500000.000000\n",
       "2         end_market_value  488816.610000\n",
       "3                total_pnl   -8620.250000\n",
       "4           unrealized_pnl   -2563.140000\n",
       "5         total_return_pct      -1.724050\n",
       "6             total_profit    8971.780000\n",
       "7               total_loss  -17592.030000\n",
       "8               total_fees       0.000000\n",
       "9             max_drawdown  -24678.790000\n",
       "10        max_drawdown_pct      -4.869287\n",
       "11                win_rate      40.000000\n",
       "12               loss_rate      60.000000\n",
       "13          winning_trades       4.000000\n",
       "14           losing_trades       6.000000\n",
       "15                 avg_pnl    -862.025000\n",
       "16          avg_return_pct      -0.341000\n",
       "17          avg_trade_bars       3.000000\n",
       "18              avg_profit    2242.945000\n",
       "19          avg_profit_pct       0.920000\n",
       "20  avg_winning_trade_bars       3.000000\n",
       "21                avg_loss   -2932.005000\n",
       "22            avg_loss_pct      -1.181667\n",
       "23   avg_losing_trade_bars       3.000000\n",
       "24             largest_win    3455.200000\n",
       "25         largest_win_pct       1.420000\n",
       "26        largest_win_bars       3.000000\n",
       "27            largest_loss   -6624.700000\n",
       "28        largest_loss_pct      -2.660000\n",
       "29       largest_loss_bars       3.000000\n",
       "30                max_wins       2.000000\n",
       "31              max_losses       6.000000\n",
       "32                  sharpe      -0.117967\n",
       "33                 sortino      -0.250087\n",
       "34           profit_factor       0.746119\n",
       "35             ulcer_index       3.617931\n",
       "36                     upi      -0.028605\n",
       "37               equity_r2       0.591262\n",
       "38               std_error    7674.257024"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.metrics_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "这些指标是算法交易策略回测中常用的评估指标，用于衡量策略的性能、风险和盈利能力。下面是对每个指标的详细解释：\n",
    "\n",
    "### 1. 交易数量与初始/最终市值\n",
    "- **`trade_count`（交易次数）**：值为 10，代表在回测期间策略执行的交易总次数，包括买入和卖出操作。它反映了策略的交易活跃度。\n",
    "- **`initial_market_value`（初始市值）**：初始投入资金为 500000，这是回测开始时投资组合的总价值。\n",
    "- **`end_market_value`（最终市值）**：回测结束时投资组合价值为 488816.61，与初始市值对比可看出策略在回测期内是盈利还是亏损。\n",
    "\n",
    "### 2. 盈亏相关指标\n",
    "- **`total_pnl`（总盈亏）**：总盈亏为 -8620.25，即回测期间策略整体亏损 8620.25，是最终市值与初始市值的差值。\n",
    "- **`unrealized_pnl`（未实现盈亏）**：未实现盈亏 -2563.14，指当前持有头寸按当前市场价格计算的盈亏，尚未通过交易实现。\n",
    "- **`total_return_pct`（总回报率百分比）**：总回报率 -1.724050%，反映策略在回测期内的整体收益情况，计算公式为 `(最终市值 - 初始市值) / 初始市值 * 100%`。\n",
    "- **`total_profit`（总盈利）**：总盈利 8971.78，是所有盈利交易的盈利总和。\n",
    "- **`total_loss`（总亏损）**：总亏损 -17592.03，是所有亏损交易的亏损总和。\n",
    "\n",
    "### 3. 交易成本与最大回撤\n",
    "- **`total_fees`（总交易费用）**：总交易费用为 0，意味着回测中未考虑交易手续费、佣金等成本。\n",
    "- **`max_drawdown`（最大回撤）**：最大回撤 -24678.79，指在回测期间投资组合从峰值到谷底的最大损失金额，反映策略可能面临的最大风险。\n",
    "- **`max_drawdown_pct`（最大回撤百分比）**：最大回撤百分比 -4.869287%，是最大回撤金额相对于峰值市值的百分比，更直观体现回撤幅度。\n",
    "\n",
    "### 4. 胜率与败率\n",
    "- **`win_rate`（胜率）**：胜率 40%，表示盈利交易次数占总交易次数的比例，计算公式为 `盈利交易次数 / 总交易次数 * 100%`。\n",
    "- **`loss_rate`（败率）**：败率 60%，即亏损交易次数占总交易次数的比例，计算公式为 `亏损交易次数 / 总交易次数 * 100%`。\n",
    "- **`winning_trades`（盈利交易次数）**：盈利交易次数为 4，是回测中实现盈利的交易笔数。\n",
    "- **`losing_trades`（亏损交易次数）**：亏损交易次数为 6，是回测中出现亏损的交易笔数。\n",
    "\n",
    "### 5. 平均盈亏与持仓时间\n",
    "- **`avg_pnl`（平均盈亏）**：平均盈亏 -862.025，是每次交易的平均盈利或亏损金额，计算公式为 `总盈亏 / 总交易次数`。\n",
    "- **`avg_return_pct`（平均回报率百分比）**：平均回报率 -0.341%，是每次交易的平均回报率。\n",
    "- **`avg_trade_bars`（平均交易周期）**：平均交易周期为 3，指每次交易平均持有的周期数（如天数、小时数等，取决于回测的时间粒度）。\n",
    "- **`avg_profit`（平均盈利）**：平均盈利 2242.945，是每次盈利交易的平均盈利金额，计算公式为 `总盈利 / 盈利交易次数`。\n",
    "- **`avg_profit_pct`（平均盈利百分比）**：平均盈利百分比 0.92%，是每次盈利交易的平均回报率。\n",
    "- **`avg_winning_trade_bars`（平均盈利交易周期）**：平均盈利交易周期为 3，指每次盈利交易平均持有的周期数。\n",
    "- **`avg_loss`（平均亏损）**：平均亏损 -2932.005，是每次亏损交易的平均亏损金额，计算公式为 `总亏损 / 亏损交易次数`。\n",
    "- **`avg_loss_pct`（平均亏损百分比）**：平均亏损百分比 -1.181667%，是每次亏损交易的平均回报率。\n",
    "- **`avg_losing_trade_bars`（平均亏损交易周期）**：平均亏损交易周期为 3，指每次亏损交易平均持有的周期数。\n",
    "\n",
    "### 6. 最大盈利与亏损\n",
    "- **`largest_win`（最大盈利）**：最大盈利 3455.2，是回测期间单笔交易的最大盈利金额。\n",
    "- **`largest_win_pct`（最大盈利百分比）**：最大盈利百分比 1.42%，是单笔交易的最大回报率。\n",
    "- **`largest_win_bars`（最大盈利交易周期）**：最大盈利交易周期为 3，指最大盈利交易持有的周期数。\n",
    "- **`largest_loss`（最大亏损）**：最大亏损 -6624.7，是回测期间单笔交易的最大亏损金额。\n",
    "- **`largest_loss_pct`（最大亏损百分比）**：最大亏损百分比 -2.66%，是单笔交易的最大亏损率。\n",
    "- **`largest_loss_bars`（最大亏损交易周期）**：最大亏损交易周期为 3，指最大亏损交易持有的周期数。\n",
    "\n",
    "### 7. 连续盈利与亏损\n",
    "- **`max_wins`（最大连续盈利次数）**：最大连续盈利次数为 2，即回测期间连续盈利的最大交易次数。\n",
    "- **`max_losses`（最大连续亏损次数）**：最大连续亏损次数为 6，即回测期间连续亏损的最大交易次数。\n",
    "\n",
    "### 8. 风险调整指标\n",
    "- **`sharpe`（夏普比率）**：夏普比率 -0.117967，衡量策略在承担单位风险时所能获得的超过无风险收益的额外收益，值越高越好，负值表示策略表现不如无风险投资。\n",
    "- **`sortino`（索提诺比率）**：索提诺比率 -0.250087，与夏普比率类似，但只考虑下行风险，负值同样表示策略表现不佳。\n",
    "- **`profit_factor`（盈利因子）**：盈利因子 0.746119，是总盈利与总亏损的绝对值之比，大于 1 表示策略总体盈利，小于 1 表示总体亏损。\n",
    "- **`ulcer_index`（溃疡指数）**：溃疡指数 3.617931，衡量投资组合的回撤深度和持续时间，值越低表示策略的回撤控制越好。\n",
    "- **`upi`（溃疡绩效指数）**：溃疡绩效指数 -0.028605，是总回报率与溃疡指数的比值，反映策略在控制回撤情况下的盈利能力，正值表示较好。\n",
    "\n",
    "### 9. 拟合优度与标准误差\n",
    "- **`equity_r2`（权益拟合优度）**：权益拟合优度 0.591262，反映策略的权益曲线与市场基准之间的拟合程度，值越接近 1 表示拟合度越高。\n",
    "- **`std_error`（标准误差）**：标准误差 7674.257024，衡量策略实际表现与预期表现之间的偏离程度，值越小表示策略表现越稳定。\n",
    "\n",
    "综合来看，这个策略在回测期间整体表现不佳，处于亏损状态，胜率较低，最大回撤和连续亏损情况也不太理想，风险调整后的收益指标为负，说明策略在控制风险和获取收益方面还有待改进。 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loading bar data...\n"
     ]
    },
    {
     "ename": "KeyError",
     "evalue": "'000001'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[12], line 6\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[38;5;66;03m# 实例化 AKShare 数据类并获取股票数据\u001b[39;00m\n\u001b[0;32m      5\u001b[0m akshare \u001b[38;5;241m=\u001b[39m AKShare()\n\u001b[1;32m----> 6\u001b[0m df \u001b[38;5;241m=\u001b[39m \u001b[43makshare\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mquery\u001b[49m\u001b[43m(\u001b[49m\u001b[43msymbols\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m000001\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstart_date\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m20200101\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mend_date\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m20230830\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43madjust\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m      8\u001b[0m \u001b[38;5;66;03m# 打印获取的股票数据的前5行\u001b[39;00m\n\u001b[0;32m      9\u001b[0m df\u001b[38;5;241m.\u001b[39mhead()\n",
      "File \u001b[1;32mc:\\Users\\Administrator\\anaconda3\\envs\\quant\\Lib\\site-packages\\pybroker\\data.py:231\u001b[0m, in \u001b[0;36mDataSource.query\u001b[1;34m(self, symbols, start_date, end_date, timeframe, adjust)\u001b[0m\n\u001b[0;32m    224\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_logger\u001b[38;5;241m.\u001b[39mdownload_bar_data_start()\n\u001b[0;32m    225\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_logger\u001b[38;5;241m.\u001b[39minfo_download_bar_data_start(\n\u001b[0;32m    226\u001b[0m     symbols\u001b[38;5;241m=\u001b[39muncached_syms,\n\u001b[0;32m    227\u001b[0m     timeframe\u001b[38;5;241m=\u001b[39mtimeframe,\n\u001b[0;32m    228\u001b[0m     start_date\u001b[38;5;241m=\u001b[39mstart_date,\n\u001b[0;32m    229\u001b[0m     end_date\u001b[38;5;241m=\u001b[39mend_date,\n\u001b[0;32m    230\u001b[0m )\n\u001b[1;32m--> 231\u001b[0m df \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fetch_data\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m    232\u001b[0m \u001b[43m    \u001b[49m\u001b[38;5;28;43mfrozenset\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43muncached_syms\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstart_date\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mend_date\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeframe\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43madjust\u001b[49m\n\u001b[0;32m    233\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    234\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[0;32m    235\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_scope\u001b[38;5;241m.\u001b[39mdata_source_cache \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m    236\u001b[0m     \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m cached_df\u001b[38;5;241m.\u001b[39mcolumns\u001b[38;5;241m.\u001b[39mempty\n\u001b[0;32m    237\u001b[0m     \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mset\u001b[39m(cached_df\u001b[38;5;241m.\u001b[39mcolumns) \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mset\u001b[39m(df\u001b[38;5;241m.\u001b[39mcolumns)\n\u001b[0;32m    238\u001b[0m ):\n\u001b[0;32m    239\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_logger\u001b[38;5;241m.\u001b[39minfo_invalidate_data_source_cache()\n",
      "File \u001b[1;32mc:\\Users\\Administrator\\anaconda3\\envs\\quant\\Lib\\site-packages\\pybroker\\ext\\data.py:47\u001b[0m, in \u001b[0;36mAKShare._fetch_data\u001b[1;34m(self, symbols, start_date, end_date, timeframe, adjust)\u001b[0m\n\u001b[0;32m     45\u001b[0m period \u001b[38;5;241m=\u001b[39m AKShare\u001b[38;5;241m.\u001b[39m_tf_to_period[formatted_tf]\n\u001b[0;32m     46\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;28mlen\u001b[39m(symbols_list)):\n\u001b[1;32m---> 47\u001b[0m     temp_df \u001b[38;5;241m=\u001b[39m \u001b[43makshare\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstock_zh_a_hist\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m     48\u001b[0m \u001b[43m        \u001b[49m\u001b[43msymbol\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msymbols_simple\u001b[49m\u001b[43m[\u001b[49m\u001b[43mi\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m     49\u001b[0m \u001b[43m        \u001b[49m\u001b[43mstart_date\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstart_date_str\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m     50\u001b[0m \u001b[43m        \u001b[49m\u001b[43mend_date\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mend_date_str\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m     51\u001b[0m \u001b[43m        \u001b[49m\u001b[43mperiod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mperiod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m     52\u001b[0m \u001b[43m        \u001b[49m\u001b[43madjust\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43madjust\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43madjust\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mis\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mnot\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m     53\u001b[0m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m     54\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m temp_df\u001b[38;5;241m.\u001b[39mcolumns\u001b[38;5;241m.\u001b[39mempty:\n\u001b[0;32m     55\u001b[0m         temp_df[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msymbol\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m symbols_list[i]\n",
      "File \u001b[1;32mc:\\Users\\Administrator\\anaconda3\\envs\\quant\\Lib\\site-packages\\akshare\\stock_feature\\stock_hist_em.py:1098\u001b[0m, in \u001b[0;36mstock_zh_a_hist\u001b[1;34m(symbol, period, start_date, end_date, adjust, timeout)\u001b[0m\n\u001b[0;32m   1090\u001b[0m period_dict \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdaily\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m101\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mweekly\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m102\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmonthly\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m103\u001b[39m\u001b[38;5;124m\"\u001b[39m}\n\u001b[0;32m   1091\u001b[0m url \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://push2his.eastmoney.com/api/qt/stock/kline/get\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m   1092\u001b[0m params \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m   1093\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfields1\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mf1,f2,f3,f4,f5,f6\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m   1094\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfields2\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mf51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f116\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m   1095\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mut\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m7eea3edcaed734bea9cbfc24409ed989\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m   1096\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mklt\u001b[39m\u001b[38;5;124m\"\u001b[39m: period_dict[period],\n\u001b[0;32m   1097\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfqt\u001b[39m\u001b[38;5;124m\"\u001b[39m: adjust_dict[adjust],\n\u001b[1;32m-> 1098\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msecid\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[43mcode_id_dict\u001b[49m\u001b[43m[\u001b[49m\u001b[43msymbol\u001b[49m\u001b[43m]\u001b[49m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.\u001b[39m\u001b[38;5;132;01m{\u001b[39;00msymbol\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m   1099\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbeg\u001b[39m\u001b[38;5;124m\"\u001b[39m: start_date,\n\u001b[0;32m   1100\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mend\u001b[39m\u001b[38;5;124m\"\u001b[39m: end_date,\n\u001b[0;32m   1101\u001b[0m     \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m1623766962675\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m   1102\u001b[0m }\n\u001b[0;32m   1103\u001b[0m r \u001b[38;5;241m=\u001b[39m requests\u001b[38;5;241m.\u001b[39mget(url, params\u001b[38;5;241m=\u001b[39mparams, timeout\u001b[38;5;241m=\u001b[39mtimeout)\n\u001b[0;32m   1104\u001b[0m data_json \u001b[38;5;241m=\u001b[39m r\u001b[38;5;241m.\u001b[39mjson()\n",
      "\u001b[1;31mKeyError\u001b[0m: '000001'"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "# 定义交易策略函数\n",
    "def buy_func(ctx: ExecContext) -> None:\n",
    "    pos = ctx.long_pos()  # 获取当前的长期持有的股票\n",
    "    if pos:  # 如果当前持有股票\n",
    "        ctx.sell_shares = pos.shares  # 卖出所有的股票\n",
    "    else:  # 如果当前没有持有股票\n",
    "        ctx.buy_shares = ctx.calc_target_shares(1)  # 买入全部可购买的股票\n",
    "        ctx.hold_bars = 3  # 设置持有的交易日为3天\n",
    "\n",
    "\n",
    "# 创建策略配置对象，设置初始现金为 500,000 元\n",
    "my_config = StrategyConfig(initial_cash=500000)\n",
    "\n",
    "# 创建策略对象，设置数据源为 AKShare，开始日期为 '20230801'，结束日期为 '20230830'，策略配置为 my_config\n",
    "strategy = Strategy(data_source=AKShare(), start_date='20230801', end_date='20230830', config=my_config)\n",
    "\n",
    "# 将定义的交易策略函数添加到策略对象中，应用于股票 '000001'\n",
    "strategy.add_execution(fn=buy_func, symbols=['000001'])\n",
    "\n",
    "# 执行回测\n",
    "result = strategy.backtest()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "TestResult(start_date=datetime.datetime(2023, 8, 1, 0, 0), end_date=datetime.datetime(2023, 8, 30, 0, 0), portfolio=                 cash     equity  margin  market_value       pnl  \\\n",
       "date                                                               \n",
       "2023-08-01  500000.00  500000.00     0.0     500000.00      0.00   \n",
       "2023-08-02    3294.56  497944.10     0.0     497944.10  -2055.90   \n",
       "2023-08-03  503289.44  503289.44     0.0     503289.44   3289.44   \n",
       "2023-08-04       3.62  500441.42     0.0     500441.42    441.42   \n",
       "2023-08-07  495559.10  495559.10     0.0     495559.10  -4440.90   \n",
       "2023-08-08    2447.80  495559.10     0.0     495559.10  -4440.90   \n",
       "2023-08-09  496374.16  496374.16     0.0     496374.16  -3625.84   \n",
       "2023-08-10    1232.12  497189.88     0.0     497189.88  -2810.12   \n",
       "2023-08-11  493927.00  493927.00     0.0     493927.00  -6073.00   \n",
       "2023-08-14    8728.12  493511.59     0.0     493511.59  -6488.41   \n",
       "2023-08-15  494757.82  494757.82     0.0     494757.82  -5242.18   \n",
       "2023-08-16       9.88  494757.82     0.0     494757.82  -5242.18   \n",
       "2023-08-17  488431.12  488431.12     0.0     488431.12 -11568.88   \n",
       "2023-08-18       5.08  485074.24     0.0     485074.24 -14925.76   \n",
       "2023-08-21  480458.53  480458.53     0.0     480458.53 -19541.47   \n",
       "2023-08-22       6.31  480036.34     0.0     480036.34 -19963.66   \n",
       "2023-08-23  478347.58  478347.58     0.0     478347.58 -21652.42   \n",
       "2023-08-24    2985.16  476221.63     0.0     476221.63 -23778.37   \n",
       "2023-08-25  479197.96  479197.96     0.0     479197.96 -20802.04   \n",
       "2023-08-28       1.34  471422.78     0.0     471422.78 -28577.22   \n",
       "2023-08-29  462829.16  462829.16     0.0     462829.16 -37170.84   \n",
       "2023-08-30    4502.76  459964.62     0.0     459964.62 -40035.38   \n",
       "\n",
       "            unrealized_pnl  fees  \n",
       "date                              \n",
       "2023-08-01             0.0   0.0  \n",
       "2023-08-02             0.0   0.0  \n",
       "2023-08-03             0.0   0.0  \n",
       "2023-08-04             0.0   0.0  \n",
       "2023-08-07             0.0   0.0  \n",
       "2023-08-08             0.0   0.0  \n",
       "2023-08-09             0.0   0.0  \n",
       "2023-08-10             0.0   0.0  \n",
       "2023-08-11             0.0   0.0  \n",
       "2023-08-14             0.0   0.0  \n",
       "2023-08-15             0.0   0.0  \n",
       "2023-08-16             0.0   0.0  \n",
       "2023-08-17             0.0   0.0  \n",
       "2023-08-18             0.0   0.0  \n",
       "2023-08-21             0.0   0.0  \n",
       "2023-08-22             0.0   0.0  \n",
       "2023-08-23             0.0   0.0  \n",
       "2023-08-24             0.0   0.0  \n",
       "2023-08-25             0.0   0.0  \n",
       "2023-08-28             0.0   0.0  \n",
       "2023-08-29             0.0   0.0  \n",
       "2023-08-30             0.0   0.0  , positions=                   long_shares  short_shares  close     equity  market_value  \\\n",
       "symbol date                                                                    \n",
       "000001 2023-08-02        41118             0  12.03  494649.54     494649.54   \n",
       "       2023-08-04        40686             0  12.30  500437.80     500437.80   \n",
       "       2023-08-08        40753             0  12.10  493111.30     493111.30   \n",
       "       2023-08-10        40786             0  12.16  495957.76     495957.76   \n",
       "       2023-08-14        41541             0  11.67  484783.47     484783.47   \n",
       "       2023-08-16        42178             0  11.73  494747.94     494747.94   \n",
       "       2023-08-18        41961             0  11.56  485069.16     485069.16   \n",
       "       2023-08-22        42219             0  11.37  480030.03     480030.03   \n",
       "       2023-08-24        42519             0  11.13  473236.47     473236.47   \n",
       "       2023-08-28        40922             0  11.52  471421.44     471421.44   \n",
       "       2023-08-30        40922             0  11.13  455461.86     455461.86   \n",
       "\n",
       "                   margin  unrealized_pnl  \n",
       "symbol date                                \n",
       "000001 2023-08-02     0.0        -2055.90  \n",
       "       2023-08-04     0.0        -2848.02  \n",
       "       2023-08-08     0.0            0.00  \n",
       "       2023-08-10     0.0          815.72  \n",
       "       2023-08-14     0.0         -415.41  \n",
       "       2023-08-16     0.0            0.00  \n",
       "       2023-08-18     0.0        -3356.88  \n",
       "       2023-08-22     0.0         -422.19  \n",
       "       2023-08-24     0.0        -2125.95  \n",
       "       2023-08-28     0.0        -7775.18  \n",
       "       2023-08-30     0.0        -2864.54  , orders=    type  symbol       date  shares  limit_price  fill_price  fees\n",
       "id                                                                \n",
       "1    buy  000001 2023-08-02   41118          NaN       12.08   0.0\n",
       "2   sell  000001 2023-08-03   41118          NaN       12.16   0.0\n",
       "3    buy  000001 2023-08-04   40686          NaN       12.37   0.0\n",
       "4   sell  000001 2023-08-07   40686          NaN       12.18   0.0\n",
       "5    buy  000001 2023-08-08   40753          NaN       12.10   0.0\n",
       "6   sell  000001 2023-08-09   40753          NaN       12.12   0.0\n",
       "7    buy  000001 2023-08-10   40786          NaN       12.14   0.0\n",
       "8   sell  000001 2023-08-11   40786          NaN       12.08   0.0\n",
       "9    buy  000001 2023-08-14   41541          NaN       11.68   0.0\n",
       "10  sell  000001 2023-08-15   41541          NaN       11.70   0.0\n",
       "11   buy  000001 2023-08-16   42178          NaN       11.73   0.0\n",
       "12  sell  000001 2023-08-17   42178          NaN       11.58   0.0\n",
       "13   buy  000001 2023-08-18   41961          NaN       11.64   0.0\n",
       "14  sell  000001 2023-08-21   41961          NaN       11.45   0.0\n",
       "15   buy  000001 2023-08-22   42219          NaN       11.38   0.0\n",
       "16  sell  000001 2023-08-23   42219          NaN       11.33   0.0\n",
       "17   buy  000001 2023-08-24   42519          NaN       11.18   0.0\n",
       "18  sell  000001 2023-08-25   42519          NaN       11.20   0.0\n",
       "19   buy  000001 2023-08-28   40922          NaN       11.71   0.0\n",
       "20  sell  000001 2023-08-29   40922          NaN       11.31   0.0\n",
       "21   buy  000001 2023-08-30   40922          NaN       11.20   0.0, trades=    type  symbol entry_date  exit_date  entry   exit  shares       pnl  \\\n",
       "id                                                                       \n",
       "1   long  000001 2023-08-02 2023-08-03  12.08  12.16   41118   3289.44   \n",
       "2   long  000001 2023-08-04 2023-08-07  12.37  12.18   40686  -7730.34   \n",
       "3   long  000001 2023-08-08 2023-08-09  12.10  12.12   40753    815.06   \n",
       "4   long  000001 2023-08-10 2023-08-11  12.14  12.08   40786  -2447.16   \n",
       "5   long  000001 2023-08-14 2023-08-15  11.68  11.70   41541    830.82   \n",
       "6   long  000001 2023-08-16 2023-08-17  11.73  11.58   42178  -6326.70   \n",
       "7   long  000001 2023-08-18 2023-08-21  11.64  11.45   41961  -7972.59   \n",
       "8   long  000001 2023-08-22 2023-08-23  11.38  11.33   42219  -2110.95   \n",
       "9   long  000001 2023-08-24 2023-08-25  11.18  11.20   42519    850.38   \n",
       "10  long  000001 2023-08-28 2023-08-29  11.71  11.31   40922 -16368.80   \n",
       "\n",
       "    return_pct   agg_pnl  bars  pnl_per_bar  stop   mae   mfe  \n",
       "id                                                             \n",
       "1         0.66   3289.44     1      3289.44  None -0.15  0.16  \n",
       "2        -1.54  -4440.90     1     -7730.34  None -0.19  0.16  \n",
       "3         0.17  -3625.84     1       815.06  None -0.10  0.11  \n",
       "4        -0.49  -6073.00     1     -2447.16  None -0.08  0.07  \n",
       "5         0.17  -5242.18     1       830.82  None -0.09  0.10  \n",
       "6        -1.28 -11568.88     1     -6326.70  None -0.15  0.12  \n",
       "7        -1.63 -19541.47     1     -7972.59  None -0.19  0.10  \n",
       "8        -0.44 -21652.42     1     -2110.95  None -0.07  0.07  \n",
       "9         0.18 -20802.04     1       850.38  None -0.13  0.14  \n",
       "10       -3.42 -37170.84     1    -16368.80  None -0.40  0.22  , metrics=EvalMetrics(trade_count=10, initial_market_value=500000.0, end_market_value=459964.62, total_pnl=-37170.84, unrealized_pnl=-2864.540000000008, total_return_pct=-7.434167999999996, annual_return_pct=None, total_profit=5785.7, total_loss=-42956.54, total_fees=0.0, max_drawdown=-43324.82000000001, max_drawdown_pct=-8.608330824505305, win_rate=40.0, loss_rate=60.0, winning_trades=4, losing_trades=6, avg_pnl=-3717.084, avg_return_pct=-0.762, avg_trade_bars=1.0, avg_profit=1446.425, avg_profit_pct=0.295, avg_winning_trade_bars=1.0, avg_loss=-7159.423333333333, avg_loss_pct=-1.4666666666666668, avg_losing_trade_bars=1.0, largest_win=3289.44, largest_win_pct=0.66, largest_win_bars=1, largest_loss=-16368.8, largest_loss_pct=-3.42, largest_loss_bars=1, max_wins=1, max_losses=3, sharpe=-0.5715556797902418, sortino=-0.7869766853183464, calmar=None, profit_factor=0.21857881261020728, ulcer_index=5.0494299817594195, upi=-0.07807840435538736, equity_r2=0.8699950729154048, std_error=12031.603751648245, annual_std_error=None, annual_volatility_pct=None), metrics_df=                      name          value\n",
       "0              trade_count      10.000000\n",
       "1     initial_market_value  500000.000000\n",
       "2         end_market_value  459964.620000\n",
       "3                total_pnl  -37170.840000\n",
       "4           unrealized_pnl   -2864.540000\n",
       "5         total_return_pct      -7.434168\n",
       "6             total_profit    5785.700000\n",
       "7               total_loss  -42956.540000\n",
       "8               total_fees       0.000000\n",
       "9             max_drawdown  -43324.820000\n",
       "10        max_drawdown_pct      -8.608331\n",
       "11                win_rate      40.000000\n",
       "12               loss_rate      60.000000\n",
       "13          winning_trades       4.000000\n",
       "14           losing_trades       6.000000\n",
       "15                 avg_pnl   -3717.084000\n",
       "16          avg_return_pct      -0.762000\n",
       "17          avg_trade_bars       1.000000\n",
       "18              avg_profit    1446.425000\n",
       "19          avg_profit_pct       0.295000\n",
       "20  avg_winning_trade_bars       1.000000\n",
       "21                avg_loss   -7159.423333\n",
       "22            avg_loss_pct      -1.466667\n",
       "23   avg_losing_trade_bars       1.000000\n",
       "24             largest_win    3289.440000\n",
       "25         largest_win_pct       0.660000\n",
       "26        largest_win_bars       1.000000\n",
       "27            largest_loss  -16368.800000\n",
       "28        largest_loss_pct      -3.420000\n",
       "29       largest_loss_bars       1.000000\n",
       "30                max_wins       1.000000\n",
       "31              max_losses       3.000000\n",
       "32                  sharpe      -0.571556\n",
       "33                 sortino      -0.786977\n",
       "34           profit_factor       0.218579\n",
       "35             ulcer_index       5.049430\n",
       "36                     upi      -0.078078\n",
       "37               equity_r2       0.869995\n",
       "38               std_error   12031.603752, bootstrap=None, signals=None, stops=None)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Backtesting: 2023-01-01 00:00:00 to 2023-07-01 00:00:00\n",
      "\n",
      "Loading bar data...\n",
      "Loaded bar data: 0:00:01 \n",
      "\n",
      "Computing indicators...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  0% (0 of 2) |                          | Elapsed Time: 0:00:00 ETA:  --:--:--\n",
      " 50% (1 of 2) |#############             | Elapsed Time: 0:00:05 ETA:   0:00:05\n",
      "100% (2 of 2) |##########################| Elapsed Time: 0:00:05 Time:  0:00:05\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Test split: 2023-01-03 00:00:00 to 2023-06-30 00:00:00\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  0% (0 of 118) |                        | Elapsed Time: 0:00:00 ETA:  --:--:--\n",
      "100% (118 of 118) |######################| Elapsed Time: 0:00:00 Time:  0:00:00\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Finished backtest: 0:00:06\n",
      "TestResult(start_date=datetime.datetime(2023, 1, 1, 0, 0), end_date=datetime.datetime(2023, 7, 1, 0, 0), portfolio=                cash    equity  margin  market_value    pnl  unrealized_pnl  \\\n",
      "date                                                                          \n",
      "2023-01-03  100000.0  100000.0     0.0      100000.0    0.0             0.0   \n",
      "2023-01-04  100000.0  100000.0     0.0      100000.0    0.0             0.0   \n",
      "2023-01-05  100000.0  100000.0     0.0      100000.0    0.0             0.0   \n",
      "2023-01-06  100000.0  100000.0     0.0      100000.0    0.0             0.0   \n",
      "2023-01-09  100000.0  100000.0     0.0      100000.0    0.0             0.0   \n",
      "...              ...       ...     ...           ...    ...             ...   \n",
      "2023-06-26   99873.7   99873.7     0.0       99873.7 -126.3             0.0   \n",
      "2023-06-27   99873.7   99873.7     0.0       99873.7 -126.3             0.0   \n",
      "2023-06-28   99873.7   99873.7     0.0       99873.7 -126.3             0.0   \n",
      "2023-06-29   99873.7   99873.7     0.0       99873.7 -126.3             0.0   \n",
      "2023-06-30   99873.7   99873.7     0.0       99873.7 -126.3             0.0   \n",
      "\n",
      "            fees  \n",
      "date              \n",
      "2023-01-03   0.0  \n",
      "2023-01-04   0.0  \n",
      "2023-01-05   0.0  \n",
      "2023-01-06   0.0  \n",
      "2023-01-09   0.0  \n",
      "...          ...  \n",
      "2023-06-26   0.0  \n",
      "2023-06-27   0.0  \n",
      "2023-06-28   0.0  \n",
      "2023-06-29   0.0  \n",
      "2023-06-30   0.0  \n",
      "\n",
      "[118 rows x 7 columns], positions=                      long_shares  short_shares  close  equity  market_value  \\\n",
      "symbol    date                                                                 \n",
      "600000.SH 2023-02-22          100             0   7.24   724.0         724.0   \n",
      "          2023-02-23          100             0   7.23   723.0         723.0   \n",
      "          2023-02-24          100             0   7.18   718.0         718.0   \n",
      "          2023-02-27          100             0   7.16   716.0         716.0   \n",
      "          2023-02-28          100             0   7.18   718.0         718.0   \n",
      "000001.SZ 2023-03-02          100             0  14.24  1424.0        1424.0   \n",
      "          2023-03-03          100             0  14.29  1429.0        1429.0   \n",
      "600000.SH 2023-03-06          100             0   7.33   733.0         733.0   \n",
      "          2023-03-07          100             0   7.31   731.0         731.0   \n",
      "          2023-03-08          100             0   7.31   731.0         731.0   \n",
      "          2023-03-09          100             0   7.27   727.0         727.0   \n",
      "          2023-04-10          100             0   7.21   721.0         721.0   \n",
      "          2023-04-11          100             0   7.18   718.0         718.0   \n",
      "          2023-04-12          100             0   7.21   721.0         721.0   \n",
      "          2023-04-13          100             0   7.25   725.0         725.0   \n",
      "          2023-04-14          100             0   7.27   727.0         727.0   \n",
      "000001.SZ 2023-04-17          100             0  12.93  1293.0        1293.0   \n",
      "          2023-04-18          100             0  13.00  1300.0        1300.0   \n",
      "600000.SH 2023-04-18          100             0   7.54   754.0         754.0   \n",
      "000001.SZ 2023-04-19          100             0  12.85  1285.0        1285.0   \n",
      "600000.SH 2023-04-19          100             0   7.53   753.0         753.0   \n",
      "000001.SZ 2023-04-20          100             0  12.75  1275.0        1275.0   \n",
      "600000.SH 2023-04-20          100             0   7.68   768.0         768.0   \n",
      "          2023-04-21          100             0   7.59   759.0         759.0   \n",
      "          2023-04-24          100             0   7.49   749.0         749.0   \n",
      "          2023-05-08          100             0   8.07   807.0         807.0   \n",
      "000001.SZ 2023-05-09          100             0  13.16  1316.0        1316.0   \n",
      "600000.SH 2023-05-09          100             0   7.96   796.0         796.0   \n",
      "          2023-06-08          100             0   7.57   757.0         757.0   \n",
      "000001.SZ 2023-06-09          100             0  11.88  1188.0        1188.0   \n",
      "600000.SH 2023-06-09          100             0   7.56   756.0         756.0   \n",
      "000001.SZ 2023-06-12          100             0  11.79  1179.0        1179.0   \n",
      "600000.SH 2023-06-12          100             0   7.43   743.0         743.0   \n",
      "          2023-06-13          100             0   7.46   746.0         746.0   \n",
      "          2023-06-14          100             0   7.40   740.0         740.0   \n",
      "\n",
      "                      margin  unrealized_pnl  \n",
      "symbol    date                                \n",
      "600000.SH 2023-02-22     0.0            -2.0  \n",
      "          2023-02-23     0.0            -3.0  \n",
      "          2023-02-24     0.0            -8.0  \n",
      "          2023-02-27     0.0           -10.0  \n",
      "          2023-02-28     0.0            -8.0  \n",
      "000001.SZ 2023-03-02     0.0            -1.0  \n",
      "          2023-03-03     0.0             4.0  \n",
      "600000.SH 2023-03-06     0.0            -1.0  \n",
      "          2023-03-07     0.0            -3.0  \n",
      "          2023-03-08     0.0            -3.0  \n",
      "          2023-03-09     0.0            -7.0  \n",
      "          2023-04-10     0.0            -1.0  \n",
      "          2023-04-11     0.0            -4.0  \n",
      "          2023-04-12     0.0            -1.0  \n",
      "          2023-04-13     0.0             3.0  \n",
      "          2023-04-14     0.0             5.0  \n",
      "000001.SZ 2023-04-17     0.0            16.0  \n",
      "          2023-04-18     0.0            23.0  \n",
      "600000.SH 2023-04-18     0.0             6.0  \n",
      "000001.SZ 2023-04-19     0.0             8.0  \n",
      "600000.SH 2023-04-19     0.0             5.0  \n",
      "000001.SZ 2023-04-20     0.0            -2.0  \n",
      "600000.SH 2023-04-20     0.0            20.0  \n",
      "          2023-04-21     0.0            11.0  \n",
      "          2023-04-24     0.0             1.0  \n",
      "          2023-05-08     0.0            11.0  \n",
      "000001.SZ 2023-05-09     0.0           -20.0  \n",
      "600000.SH 2023-05-09     0.0             0.0  \n",
      "          2023-06-08     0.0             6.0  \n",
      "000001.SZ 2023-06-09     0.0            -9.0  \n",
      "600000.SH 2023-06-09     0.0             5.0  \n",
      "000001.SZ 2023-06-12     0.0           -18.0  \n",
      "600000.SH 2023-06-12     0.0            -8.0  \n",
      "          2023-06-13     0.0            -5.0  \n",
      "          2023-06-14     0.0           -11.0  , orders=    type     symbol       date  shares  limit_price  fill_price  fees\n",
      "id                                                                   \n",
      "1    buy  600000.SH 2023-02-22     100          NaN        7.26   0.0\n",
      "2   sell  600000.SH 2023-03-01     100          NaN        7.22   0.0\n",
      "3    buy  000001.SZ 2023-03-02     100          NaN       14.25   0.0\n",
      "4   sell  000001.SZ 2023-03-06     100          NaN       13.97   0.0\n",
      "5    buy  600000.SH 2023-03-06     100          NaN        7.34   0.0\n",
      "6   sell  600000.SH 2023-03-10     100          NaN        7.19   0.0\n",
      "7    buy  600000.SH 2023-04-10     100          NaN        7.22   0.0\n",
      "8   sell  600000.SH 2023-04-17     100          NaN        7.33   0.0\n",
      "9    buy  000001.SZ 2023-04-17     100          NaN       12.77   0.0\n",
      "10   buy  600000.SH 2023-04-18     100          NaN        7.48   0.0\n",
      "11  sell  000001.SZ 2023-04-21     100          NaN       12.51   0.0\n",
      "12  sell  600000.SH 2023-04-25     100          NaN        7.57   0.0\n",
      "13   buy  600000.SH 2023-05-08     100          NaN        7.96   0.0\n",
      "14   buy  000001.SZ 2023-05-09     100          NaN       13.36   0.0\n",
      "15  sell  600000.SH 2023-05-10     100          NaN        7.80   0.0\n",
      "16  sell  000001.SZ 2023-05-10     100          NaN       13.09   0.0\n",
      "17   buy  600000.SH 2023-06-08     100          NaN        7.51   0.0\n",
      "18   buy  000001.SZ 2023-06-09     100          NaN       11.97   0.0\n",
      "19  sell  000001.SZ 2023-06-13     100          NaN       11.73   0.0\n",
      "20  sell  600000.SH 2023-06-15     100          NaN        7.44   0.0, trades=    type     symbol entry_date  exit_date  entry   exit  shares    pnl  \\\n",
      "id                                                                       \n",
      "1   long  600000.SH 2023-02-22 2023-03-01   7.26   7.22     100  -4.00   \n",
      "2   long  000001.SZ 2023-03-02 2023-03-06  14.25  13.97     100 -28.50   \n",
      "3   long  600000.SH 2023-03-06 2023-03-10   7.34   7.19     100 -14.68   \n",
      "4   long  600000.SH 2023-04-10 2023-04-17   7.22   7.33     100  11.00   \n",
      "5   long  000001.SZ 2023-04-17 2023-04-21  12.77  12.51     100 -25.54   \n",
      "6   long  600000.SH 2023-04-18 2023-04-25   7.48   7.57     100   9.00   \n",
      "7   long  600000.SH 2023-05-08 2023-05-10   7.96   7.80     100 -15.92   \n",
      "8   long  000001.SZ 2023-05-09 2023-05-10  13.36  13.09     100 -26.72   \n",
      "9   long  000001.SZ 2023-06-09 2023-06-13  11.97  11.73     100 -23.94   \n",
      "10  long  600000.SH 2023-06-08 2023-06-15   7.51   7.44     100  -7.00   \n",
      "\n",
      "    return_pct  agg_pnl  bars  pnl_per_bar  stop   mae   mfe  \n",
      "id                                                            \n",
      "1        -0.55    -4.00     5        -0.80   bar -0.12  0.03  \n",
      "2        -2.00   -32.50     2       -14.25  loss -0.29  0.19  \n",
      "3        -2.00   -47.18     4        -3.67  loss -0.15  0.12  \n",
      "4         1.52   -36.18     5         2.20   bar -0.05  0.11  \n",
      "5        -2.00   -61.72     4        -6.39  loss -0.26  0.43  \n",
      "6         1.20   -52.72     5         1.80   bar -0.11  0.25  \n",
      "7        -2.00   -68.64     2        -7.96  loss -0.20  0.26  \n",
      "8        -2.00   -95.36     1       -26.72  loss -0.27  0.24  \n",
      "9        -2.00  -119.30     2       -11.97  loss -0.24  0.12  \n",
      "10       -0.93  -126.30     5        -1.40   bar -0.11  0.09  , metrics=EvalMetrics(trade_count=10, initial_market_value=100000.0, end_market_value=99873.7, total_pnl=-126.3, unrealized_pnl=-2.9132252166164108e-12, total_return_pct=-0.1263000000000014, annual_return_pct=None, total_profit=20.0, total_loss=-146.3, total_fees=0.0, max_drawdown=-130.3000000000029, max_drawdown_pct=-0.13030000000003872, win_rate=20.0, loss_rate=80.0, winning_trades=2, losing_trades=8, avg_pnl=-12.629999999999999, avg_return_pct=-1.076, avg_trade_bars=3.5, avg_profit=10.0, avg_profit_pct=1.3599999999999999, avg_winning_trade_bars=5.0, avg_loss=-18.2875, avg_loss_pct=-1.685, avg_losing_trade_bars=3.125, largest_win=11.0, largest_win_pct=1.52, largest_win_bars=5, largest_loss=-28.5, largest_loss_pct=-2.0, largest_loss_bars=2, max_wins=1, max_losses=4, sharpe=-0.15581113647095293, sortino=-0.09762036383519859, calmar=None, profit_factor=0.41337668369743363, ulcer_index=0.03270554702835016, upi=-0.033019579539121456, equity_r2=0.8884912984401415, std_error=43.417314435481934, annual_std_error=None, annual_volatility_pct=None), metrics_df=                      name         value\n",
      "0              trade_count  1.000000e+01\n",
      "1     initial_market_value  1.000000e+05\n",
      "2         end_market_value  9.987370e+04\n",
      "3                total_pnl -1.263000e+02\n",
      "4           unrealized_pnl -2.913225e-12\n",
      "5         total_return_pct -1.263000e-01\n",
      "6             total_profit  2.000000e+01\n",
      "7               total_loss -1.463000e+02\n",
      "8               total_fees  0.000000e+00\n",
      "9             max_drawdown -1.303000e+02\n",
      "10        max_drawdown_pct -1.303000e-01\n",
      "11                win_rate  2.000000e+01\n",
      "12               loss_rate  8.000000e+01\n",
      "13          winning_trades  2.000000e+00\n",
      "14           losing_trades  8.000000e+00\n",
      "15                 avg_pnl -1.263000e+01\n",
      "16          avg_return_pct -1.076000e+00\n",
      "17          avg_trade_bars  3.500000e+00\n",
      "18              avg_profit  1.000000e+01\n",
      "19          avg_profit_pct  1.360000e+00\n",
      "20  avg_winning_trade_bars  5.000000e+00\n",
      "21                avg_loss -1.828750e+01\n",
      "22            avg_loss_pct -1.685000e+00\n",
      "23   avg_losing_trade_bars  3.125000e+00\n",
      "24             largest_win  1.100000e+01\n",
      "25         largest_win_pct  1.520000e+00\n",
      "26        largest_win_bars  5.000000e+00\n",
      "27            largest_loss -2.850000e+01\n",
      "28        largest_loss_pct -2.000000e+00\n",
      "29       largest_loss_bars  2.000000e+00\n",
      "30                max_wins  1.000000e+00\n",
      "31              max_losses  4.000000e+00\n",
      "32                  sharpe -1.558111e-01\n",
      "33                 sortino -9.762036e-02\n",
      "34           profit_factor  4.133767e-01\n",
      "35             ulcer_index  3.270555e-02\n",
      "36                     upi -3.301958e-02\n",
      "37               equity_r2  8.884913e-01\n",
      "38               std_error  4.341731e+01, bootstrap=None, signals=None, stops=None)\n"
     ]
    }
   ],
   "source": [
    "from pybroker import Strategy\n",
    "from pybroker.ext.data import AKShare\n",
    "from pybroker import highest\n",
    "\n",
    "def exec_fn(ctx):\n",
    "    # 获取 10 日最高价的指标数据\n",
    "    high_10d = ctx.indicator('high_10d')\n",
    "    # 如果没有多头仓位，且当前价格突破 10 日最高价，则买入 100 股\n",
    "    if not ctx.long_pos() and high_10d[-1] > high_10d[-2]:\n",
    "        ctx.buy_shares = 100\n",
    "        # 持有 5 天\n",
    "        ctx.hold_bars = 5\n",
    "        # 设置 2% 的止损\n",
    "        ctx.stop_loss_pct = 2\n",
    "\n",
    "# 创建策略，使用 AKShare 数据源，指定开始和结束日期\n",
    "strategy = Strategy(AKShare(), start_date='1/1/2023', end_date='7/1/2023')\n",
    "# 添加执行函数，指定交易的股票代码和所需的指标\n",
    "strategy.add_execution(\n",
    "    exec_fn, \n",
    "    ['600000.SH', '000001.SZ'],  # 这里可以根据需要修改股票代码\n",
    "    indicators=highest('high_10d', 'close', period=10)\n",
    ")\n",
    "\n",
    "# 进行回测，前 20 天作为预热期\n",
    "result = strategy.backtest(warmup=20)\n",
    "\n",
    "# 打印回测结果\n",
    "print(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Backtesting: 2023-01-01 00:00:00 to 2023-12-31 00:00:00\n",
      "\n",
      "Loading bar data...\n",
      "Loaded bar data: 0:00:00 \n",
      "\n",
      "Test split: 2023-01-03 00:00:00 to 2023-12-29 00:00:00\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  0% (0 of 242) |                        | Elapsed Time: 0:00:00 ETA:  --:--:--\n",
      "100% (242 of 242) |######################| Elapsed Time: 0:00:00 Time:  0:00:00\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Finished backtest: 0:00:00\n",
      "TestResult(start_date=datetime.datetime(2023, 1, 1, 0, 0), end_date=datetime.datetime(2023, 12, 31, 0, 0), portfolio=                cash    equity  margin  market_value   pnl  unrealized_pnl  \\\n",
      "date                                                                         \n",
      "2023-01-03  100000.0  100000.0     0.0      100000.0   0.0             0.0   \n",
      "2023-01-04  100000.0  100000.0     0.0      100000.0   0.0             0.0   \n",
      "2023-01-05  100000.0  100000.0     0.0      100000.0   0.0             0.0   \n",
      "2023-01-06  100000.0  100000.0     0.0      100000.0   0.0             0.0   \n",
      "2023-01-09  100000.0  100000.0     0.0      100000.0   0.0             0.0   \n",
      "...              ...       ...     ...           ...   ...             ...   \n",
      "2023-12-25   99926.0   99926.0     0.0       99926.0 -74.0             0.0   \n",
      "2023-12-26   99926.0   99926.0     0.0       99926.0 -74.0             0.0   \n",
      "2023-12-27   99926.0   99926.0     0.0       99926.0 -74.0             0.0   \n",
      "2023-12-28   99926.0   99926.0     0.0       99926.0 -74.0             0.0   \n",
      "2023-12-29   99926.0   99926.0     0.0       99926.0 -74.0             0.0   \n",
      "\n",
      "            fees  \n",
      "date              \n",
      "2023-01-03   0.0  \n",
      "2023-01-04   0.0  \n",
      "2023-01-05   0.0  \n",
      "2023-01-06   0.0  \n",
      "2023-01-09   0.0  \n",
      "...          ...  \n",
      "2023-12-25   0.0  \n",
      "2023-12-26   0.0  \n",
      "2023-12-27   0.0  \n",
      "2023-12-28   0.0  \n",
      "2023-12-29   0.0  \n",
      "\n",
      "[242 rows x 7 columns], positions=                      long_shares  short_shares  close  equity  market_value  \\\n",
      "symbol    date                                                                 \n",
      "600000.SH 2023-03-06          100             0   7.33   733.0         733.0   \n",
      "          2023-03-07          100             0   7.31   731.0         731.0   \n",
      "          2023-03-08          100             0   7.31   731.0         731.0   \n",
      "          2023-03-09          100             0   7.27   727.0         727.0   \n",
      "          2023-03-10          100             0   7.15   715.0         715.0   \n",
      "...                           ...           ...    ...     ...           ...   \n",
      "          2023-11-23          100             0   6.93   693.0         693.0   \n",
      "          2023-11-24          100             0   6.95   695.0         695.0   \n",
      "          2023-11-27          100             0   6.90   690.0         690.0   \n",
      "          2023-11-28          100             0   6.87   687.0         687.0   \n",
      "          2023-11-29          100             0   6.82   682.0         682.0   \n",
      "\n",
      "                      margin  unrealized_pnl  \n",
      "symbol    date                                \n",
      "600000.SH 2023-03-06     0.0            -1.0  \n",
      "          2023-03-07     0.0            -3.0  \n",
      "          2023-03-08     0.0            -3.0  \n",
      "          2023-03-09     0.0            -7.0  \n",
      "          2023-03-10     0.0           -19.0  \n",
      "...                      ...             ...  \n",
      "          2023-11-23     0.0            -2.0  \n",
      "          2023-11-24     0.0             0.0  \n",
      "          2023-11-27     0.0            -5.0  \n",
      "          2023-11-28     0.0            -8.0  \n",
      "          2023-11-29     0.0           -13.0  \n",
      "\n",
      "[82 rows x 7 columns], orders=    type     symbol       date  shares  limit_price  fill_price  fees\n",
      "id                                                                   \n",
      "1    buy  600000.SH 2023-03-06     100          NaN        7.34   0.0\n",
      "2   sell  600000.SH 2023-03-14     100          NaN        7.04   0.0\n",
      "3    buy  600000.SH 2023-04-04     100          NaN        7.19   0.0\n",
      "4   sell  600000.SH 2023-05-22     100          NaN        7.56   0.0\n",
      "5    buy  600000.SH 2023-06-12     100          NaN        7.48   0.0\n",
      "6   sell  600000.SH 2023-06-21     100          NaN        7.32   0.0\n",
      "7    buy  600000.SH 2023-07-17     100          NaN        7.40   0.0\n",
      "8   sell  600000.SH 2023-07-26     100          NaN        7.30   0.0\n",
      "9    buy  600000.SH 2023-07-31     100          NaN        7.58   0.0\n",
      "10  sell  600000.SH 2023-08-14     100          NaN        7.20   0.0\n",
      "11   buy  600000.SH 2023-09-15     100          NaN        7.12   0.0\n",
      "12  sell  600000.SH 2023-10-11     100          NaN        7.04   0.0\n",
      "13   buy  600000.SH 2023-11-16     100          NaN        6.95   0.0\n",
      "14  sell  600000.SH 2023-11-30     100          NaN        6.86   0.0, trades=    type     symbol entry_date  exit_date  entry  exit  shares   pnl  \\\n",
      "id                                                                     \n",
      "1   long  600000.SH 2023-03-06 2023-03-14   7.34  7.04     100 -30.0   \n",
      "2   long  600000.SH 2023-04-04 2023-05-22   7.19  7.56     100  37.0   \n",
      "3   long  600000.SH 2023-06-12 2023-06-21   7.48  7.32     100 -16.0   \n",
      "4   long  600000.SH 2023-07-17 2023-07-26   7.40  7.30     100 -10.0   \n",
      "5   long  600000.SH 2023-07-31 2023-08-14   7.58  7.20     100 -38.0   \n",
      "6   long  600000.SH 2023-09-15 2023-10-11   7.12  7.04     100  -8.0   \n",
      "7   long  600000.SH 2023-11-16 2023-11-30   6.95  6.86     100  -9.0   \n",
      "\n",
      "    return_pct  agg_pnl  bars  pnl_per_bar  stop   mae   mfe  \n",
      "id                                                            \n",
      "1        -4.09    -30.0     6        -5.00  None -0.31  0.12  \n",
      "2         5.15      7.0    30         1.23  None -0.03  1.03  \n",
      "3        -2.14     -9.0     7        -2.29  None -0.19  0.06  \n",
      "4        -1.35    -19.0     7        -1.43  None -0.33  0.08  \n",
      "5        -5.01    -57.0    10        -3.80  loss -0.38  0.07  \n",
      "6        -1.12    -65.0    12        -0.67  None -0.12  0.08  \n",
      "7        -1.29    -74.0    10        -0.90  None -0.15  0.05  , metrics=EvalMetrics(trade_count=7, initial_market_value=100000.0, end_market_value=99926.0, total_pnl=-74.0, unrealized_pnl=0.0, total_return_pct=-0.07399999999999629, annual_return_pct=None, total_profit=37.0, total_loss=-111.0, total_fees=0.0, max_drawdown=-136.0, max_drawdown_pct=-0.13592116572388457, win_rate=14.285714285714285, loss_rate=85.71428571428571, winning_trades=1, losing_trades=6, avg_pnl=-10.571428571428571, avg_return_pct=-1.4071428571428568, avg_trade_bars=11.714285714285714, avg_profit=37.0, avg_profit_pct=5.15, avg_winning_trade_bars=30.0, avg_loss=-18.5, avg_loss_pct=-2.5, avg_losing_trade_bars=8.666666666666666, largest_win=37.0, largest_win_pct=5.15, largest_win_bars=30, largest_loss=-38.0, largest_loss_pct=-5.01, largest_loss_bars=10, max_wins=1, max_losses=5, sharpe=-0.06064913690839568, sortino=-0.05028378978241883, calmar=None, profit_factor=0.7516778523490766, ulcer_index=0.017349742783247316, upi=-0.017697033337265966, equity_r2=0.6831787526601392, std_error=31.568372147986434, annual_std_error=None, annual_volatility_pct=None), metrics_df=                      name          value\n",
      "0              trade_count       7.000000\n",
      "1     initial_market_value  100000.000000\n",
      "2         end_market_value   99926.000000\n",
      "3                total_pnl     -74.000000\n",
      "4           unrealized_pnl       0.000000\n",
      "5         total_return_pct      -0.074000\n",
      "6             total_profit      37.000000\n",
      "7               total_loss    -111.000000\n",
      "8               total_fees       0.000000\n",
      "9             max_drawdown    -136.000000\n",
      "10        max_drawdown_pct      -0.135921\n",
      "11                win_rate      14.285714\n",
      "12               loss_rate      85.714286\n",
      "13          winning_trades       1.000000\n",
      "14           losing_trades       6.000000\n",
      "15                 avg_pnl     -10.571429\n",
      "16          avg_return_pct      -1.407143\n",
      "17          avg_trade_bars      11.714286\n",
      "18              avg_profit      37.000000\n",
      "19          avg_profit_pct       5.150000\n",
      "20  avg_winning_trade_bars      30.000000\n",
      "21                avg_loss     -18.500000\n",
      "22            avg_loss_pct      -2.500000\n",
      "23   avg_losing_trade_bars       8.666667\n",
      "24             largest_win      37.000000\n",
      "25         largest_win_pct       5.150000\n",
      "26        largest_win_bars      30.000000\n",
      "27            largest_loss     -38.000000\n",
      "28        largest_loss_pct      -5.010000\n",
      "29       largest_loss_bars      10.000000\n",
      "30                max_wins       1.000000\n",
      "31              max_losses       5.000000\n",
      "32                  sharpe      -0.060649\n",
      "33                 sortino      -0.050284\n",
      "34           profit_factor       0.751678\n",
      "35             ulcer_index       0.017350\n",
      "36                     upi      -0.017697\n",
      "37               equity_r2       0.683179\n",
      "38               std_error      31.568372, bootstrap=None, signals=None, stops=None)\n"
     ]
    }
   ],
   "source": [
    "import talib\n",
    "from pybroker import Strategy\n",
    "from pybroker.ext.data import AKShare\n",
    "\n",
    "\n",
    "def exec_fn(ctx):\n",
    "    close_prices = ctx.close\n",
    "    # 使用 TA-Lib 计算 5 日简单移动平均线\n",
    "    sma_5 = talib.SMA(close_prices, timeperiod=5)\n",
    "    # 使用 TA-Lib 计算 20 日简单移动平均线\n",
    "    sma_20 = talib.SMA(close_prices, timeperiod=20)\n",
    "\n",
    "    # 检查是否发生黄金交叉\n",
    "    if not ctx.long_pos() and sma_5[-1] > sma_20[-1] and sma_5[-2] <= sma_20[-2]:\n",
    "        # 当发生黄金交叉且没有多头仓位时，买入 100 股\n",
    "        ctx.buy_shares = 100\n",
    "        # 设置 5% 的止损\n",
    "        ctx.stop_loss_pct = 5\n",
    "\n",
    "    # 检查是否发生死亡交叉（短期均线向下穿过长期均线）\n",
    "    elif ctx.long_pos() and sma_5[-1] < sma_20[-1] and sma_5[-2] >= sma_20[-2]:\n",
    "        # 当发生死亡交叉且持有多头仓位时，卖出所有股票\n",
    "        ctx.sell_all_shares()\n",
    "\n",
    "\n",
    "# 创建策略，使用 AKShare 作为数据源，设置回测的起始和结束日期\n",
    "strategy = Strategy(AKShare(), start_date='2023-01-01', end_date='2023-12-31')\n",
    "\n",
    "# 添加执行函数，指定交易的股票代码\n",
    "strategy.add_execution(\n",
    "    exec_fn,\n",
    "    ['600000.SH'],  # 这里可以根据需要修改股票代码\n",
    ")\n",
    "\n",
    "# 进行回测，设置 20 天的预热期\n",
    "result = strategy.backtest(warmup=20)\n",
    "\n",
    "# 打印回测结果\n",
    "print(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2021-03-01          NaN\n",
       "2021-03-01          NaN\n",
       "2021-03-02          NaN\n",
       "2021-03-02          NaN\n",
       "2021-03-03          NaN\n",
       "                ...    \n",
       "2023-02-27    48.687855\n",
       "2023-02-28    51.196717\n",
       "2023-02-28    48.697929\n",
       "2023-03-01    51.345340\n",
       "2023-03-01    48.728674\n",
       "Length: 974, dtype: float64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import talib\n",
    "import pybroker\n",
    "\n",
    "rsi_20 = pybroker.indicator('rsi_20', lambda data: talib.RSI(data.close, timeperiod=20))\n",
    "rsi_20(df)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "quant",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
